I’ve updated php.ini and moved php_mysql.dll as explained in steps 6 and 8 here.
I get this error…
Fatal error: Call to undefined function mysql_connect() in C:\inetpub...
MySQL doesn’t show up in my phpinfo; report.
I’ve updated the c:\Windows\php.ini file from
; Directory in which the loadable extensions (modules) reside. extension_dir = './'
to
; Directory in which the loadable extensions (modules) reside. extension_dir = '.;c:\Windows\System32'
Result: no change.
I changed the php.ini value of extension_dir thusly:
extension_dir = 'C:\Windows\System32'
Result: much more in the phpinfo; report, but MySQL still isn’t working.
I copied the file libmysql.dll from folder C:\php to folders C:\Windows\System32 and C:\Windows
Result: no change.
I stopped and restarted IIS.
Result: new, different errors instead!
Warning: mysql_connect() [function.mysql-connect]: Access denied for user '...'@'localhost' (using password: YES) in C:\inetpub\... error in query.
Fatal error: Call to a member function RecordCount() on a non-object in C:\inetpub\...
I found several .php files in the website where I had to set variables:
$db_user $db_pass
Result: The site works!
As the others say these two values in php.ini are crucial.
I have the following in my php.ini: note the trailing slash – not sure if it is needed – but it does work.
Also it is worth ensuring that you only have one copy of php.ini on your machine – I’ve had problems with this where I’ve been editting a php.ini file which php isn’t using and getting very frustrated until I realised.
Also if php is running as a module within apache you will need to restart the apache server to pickup the changes. Wise to do this in anycase if you’re not sure.
a ‘php -m’ from the cmd prompt will show you the modules that are loaded from the ini file.