views:

2016

answers:

7

I'm running Vista 64 box, and attempting to setup Joomla using IIS7 (I like Joomla, I want to have some asp.net components on my web site, so that's why I want to use IIS7 and not Apache). It's my first time installing both php and mysql, so it's very possible that I'm doing something obviously wrong... though I think I tried enough diagnostic steps (described below) that there's nothing obviously wrong to me...

I installed PHP (32 bit, 5.2.8), and that seems to work ok: I got a test.php that displays phpinfo in an IIS7-served web page.

I also installed mySQL (32 bit, 5.1.31, downloaded from http://dev.mysql.com/downloads/mysql/5.1.html#win32 ). That seems to work fine too (I can connect to it using MySQL Administrator).

I've setup php.ini and what not to turn on the mySQL extension. If I do php -m from the command line I see mysql in the list. However, with phpinfo (either from the command line (php -info) or served via IIS (in a test.php file)), there is no mysql section. Because mysql is not even showing up in the command-line call of php, I don't think this has anything to do with IIS -- just an install of mysql & php on vista.

I didn't install mysql 64bit because I have an 32bit install of php, and since mysql 32 bit seems to work fine I assume that's not the issue. It seems there is no official 64bit version of php so that's why I installed that (and again, that seems to work fine).

I currently have UAC disabled, so that's not the issue.

If I put the semi-colon back in front of extension=php_mysql.dll in my php.ini then when running php -m, the mysql module doesn't show up. If I take it out again then it shows up. So I'm at least certain I'm modifying the right php.ini .

I've copied libeay32.dll, libmysql.dll, and php_mysql.dll to c:\windows\system32. I've taken them out and that doesn't seem to make a difference to the output of php -m (i.e., mysql still shows up there if the module is uncommented from php.ini).

I also tried copying the dlls ibeay32.dll, libmysql.dll, and php_mysql.dll to c:\windows\sysWOW64; that made no difference.

It seems like the smallest positive step would be for mysql to show up when running php -info from the command line. Is there any further thing I should try to figure out why mysql is showing up in php -m and not with php -info? Or am I off track as using this to gauge whether php can talk to mysql?

Thanks!

A: 

Are you sure the same php.ini is used for CLI and IIS? On POSIX-compatible systems, php normally uses two different ones. In my experience, inadvertly using the wrong php.ini is the major roadblock for php on Windows.

Try slightly changing an option in php.ini (like memory_limit to 129M instead of 128M or so) and use ini_get to find out whether the change affects php@IIS/@CLI. If this indeed only affects php@IIS, search for php.ini on C: - maybe there's a second one (usually in the PATH, like C:\Windows\php.ini).

phihag
A: 

The following is a link to a nice step-by-step article that I have followed successfully. It does not address x64 specifically, but honestly I don't think that is the problem with your configuration. Link

+1  A: 

I've solved most of it.

The answer was to copy libmysql.dll to sysWOW64. The other dlls are not needed, and nothing needs to be copied to system32. I guess this is a result of using php32 on a 64 bit system.

I thought that didn't work at first because running php -info from the command line still doesn't show mysql. However, running phpinfo from a php file served by IIS does show mysql.

I still don't know why mysql doesn't show up when running php -info from the command line, but I guess I can live with this for now.

Jimmy
+1  A: 
Stewart Robinson
A: 

I had nearly the same problem on vista 64 the problem was the the libmysql.dll from the php installation in system32 was overwritten by the mysql installation i replaced it and, mysqladmin and joomla worked fine.

Interesting. I guess that must have been a 64-bit version of mysql? Because on Vista x64 the system32 dir is reserved for 64-bit dll's (unfortunate choice of names, that system32 is for 64-bit dll's and SysWOW64 is for 32-bit dll's!)
Jimmy
A: 

You can also try setting up a separate Application Pool in IIS7 for 32 bit apps, then in the Advanced settings for the pool, set "Enable 32-Applications" to true (default is false). Then set the php site to use that app pool.

A: 

Jimmy - that was totally my problem, thanks very much. I created an account here just to give you props buddy nice job.

And to the "bundled solution" people out there - where's your sense of adventure? Booo :)

Steve
Hehe -- thanks for the feedback :)
Jimmy