Since you're getting the error Fatal error: Call to undefined function mysql_connect()
, that means that the MySQL extension is not being loaded by PHP. This is configured in your php.ini file.
To find the location of your php.ini file, create a php file and in it paste the following.
<?php phpinfo(); ?>
On the page (near the top) you will have an entry labelled Loaded Configuration File. Check this file that has been loaded is actually the one that you expect it to load. Personally, mine loads from C:/php/php.ini
, but if I recall correctly when I was initially setting it all up, it was trying to read from C:/Windows/php.ini
(which didn't exist) so was using defaults for everything, which didn't include some of the extra modules I wanted.
Open that file with your favourite text editor and in there should be several lines beginning extension=xxxxx.dll
.
Look through the list of modules and check that extension=php_mysql.dll
is listed and the first character of the line is not a semi-colon (;
). If it's not listed, just add it to the list - if it has the semi-colon at the beginning of the line, remove the semi-colon and save the file.
You should also check the value of extension_dir
, and also verify this path exists on the filesystem. This should be something similar to c:/php/ext
.
Once you've made changes to the php.ini file, you will need to restart Apache so the configuration file is re-read.
Once you've restarted Apache, refresh your phpinfo page and check that it has sections listed for MySQL.
You might also want to check if C:\php
is included in your PATH environment variable.
If you're still having issues, try firing up a command line and cd to C:\php and type php -v
. This will output the PHP version, but will often spit out more error messages than are shown when loading a web page
Using standard https to view files on the server, does that generate any ssl error messsages? If so, it means your certificates are not set up properly. If there are no errors, I have no idea what's goin on unless there is a secondary level if restrictions for creating them.
Best Answer
Try running
php -i
(or executingphpinfo()
in a script) and check the following :session
extension loaded ? (runningphp -m|grep session
or executingfunction_exists("session_start")
will also answer to this question)