By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,016 Members | 2,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,016 IT Pros & Developers. It's quick & easy.

Fatal Error: Win2003 & mysql_connect function [PLEASE HELP]

P: n/a
I am running Win2k3 Server and when I try to use the mysql_connect
function I am getting an error:

Fatal error: Call to undefined function mysql_connect() in
C:\Inetpub\wwwroot\programs\index.php on line 8

Now, I def know I've configured my php.ini correctly (its literally the
same as my XP machine) and I know that mysql works fine with PHP as I
can run it from the command line :D
I've got the files (tried in multiple places - but happiest with it in
my php & php/ext dirs with Windows path set.)
PHP 5 is running as an ISAPI (for some reason I cant get the CGI to
parse php files).
I have amended my php.ini with the doc_root, and cgi-force_redirect and
extension dir - all the permissions on my php / inetpub folders have
been given set for iusr, iwam and IWG full control (purely for
troubleshooting).
MySQL is 4.1, IIS 6.0 on Windows 2003 with PHP 5.

Its caused me lots of grief so any help would be much appreciated!

Regards

FrobinRobin

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Make a call to phpinfo() and tell me exactly what the value of:
"Configuration File (php.ini) Path" is. Also, you should use the mysqli
extension with MySQL 4.1+

Remember, PHP 5 requires mysql a dll file loaded in php.ini whereas PHP
4 does not. See the manual for details.

Jul 17 '05 #2

P: n/a
Thanks Philip, I can blatantly see that my PHP path is set to
c:\windows when the php.ini doesnt even exist in that dir!
This is my first Win2003 install (I've usually used WinXP/2000) and
I've come across quite a few differences with configuring for 2003.
Sure enough as soon as I put a copy in c:\windows - phpinfo displays
the filename as well as the path!
I soon found a way to correct the php.ini file location by creating a
registry file as follows:

[HKEY_LOCAL_MACHINE\SOFTWARE\PHP]
"IniFilePath"="c:\\PHP"

A quick restart of IIS6 and it all works fine.
Thank you very much for your help Philip!

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.