Jump to content

Can't select from mysql in root folder, but no problem in subfolders


Recommended Posts

Strange problem I'm having.  From the root of my website I can not select any data from my database.  But in a subfolder (dev) I have an exact copy of my website and there I have no problem selecting from the same database.

 

First some background:

[*]I've recently moved my website to a new server (Windows 2008 R2 IIS 7.5 MySQL

[*]The server has Plesk 10.5 installed

[*]My site is sharing the MySQL database with Plesk which is MySQL 5.1

[*]Plesk is using PHP version 5.2.1.7 thread safe version

[*]It is my understanding that PHP 5.4 non thread safe with Fast CGI is the fastest setup

[*]I downloaded and installed a non-thread safe version of PHP 5.4 because I want the best possible performance

[*]I installed PHP Manager in IIS to easily switch between the different versions of PHP

 

So I can run my website using PHP 5.4 without any problems except that the performance is just o.k. and frankly disappointing after hearing everybody rave about it.  If I switch to using the Plesk PHP 5.2 however the performance is blazingly fast (which surprised me).  So this works great in my dev environment which is a sub folder under the root of my website. 

 

Using PHP 5.2 however causes a problem in my prod environment (root folder) and only in my prod environment.  My site can connect to the database without a problem but as soon as I try to select data I get the following error:

 

Access denied for user 'ODBC'@'localhost' (using password: NO)

 

Obviously dev is connecting to different database instance so I thought there might be an issue with my prod database, but when I used my dev environment to connect to the prod database there was no problem at all.  So it seems there is no problem with the database.

 

I thought there might be a permission issue on the root folder but the dev folder inherits all its permissions from the root and since the dev folder has no problem selecting from either database instance I figure it can not be a file system permission issue.

 

The website files in dev and prod are identical with the only exception being that there is a web.config file in my prod folder and not in my dev folder, which I guess makes sense because any web pages executing in sub folders will use the web.config from the root.

 

My thinking is that this is a pathing issue.  Perhaps there is some relative path defined somewhere that should be an absolute path but all the paths I see in web.config and php.ini are absolute.  Essentially I have hit a wall and am turning to the php freaks to see if anybody has any insight that can help me track this down.

 

Any thoughts would be appreciated.  A little brainstorming might be all I need here.

 

Vincent.

 

I figured out what was causing the error, although I still don't know why it caused an error.  When I removed the following line out of my web.config file the error went away.

 

<add name="PHP - FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php-cgi.exe" resourceType="Either" />

 

So that was a reference to the fast CGI module for the plesk version of PHP.

 

Unfortunately, by removing this I also lost the blazing fast speed that I was looking for.  sigh.  So the problem has kind of morphed from "help me get rid of this error" to "help me speed up my PHP setup".

 

I would still love if somebody could shed some light on this for me.  I never expected this to be so tricky.  Anybody have any similar experiences?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.