Resources /
Programming / PHP mySQL Installation Problems IIS 5
Install PHP and mySQL on Windows XP Pro With IIS 5
I have been installing mySQL and PHP since 1998. You'd think I know something about it but eveytime I do it again it can be a nightmare. I generally do an installation every year or so which means I've forgotten what I did the previous time. Considering that options keep changing, it can be a nightmare to get these two working. I used to have a specific check list, but because the PHP install kept changing, I have laid down a few general guidelines below.
php
1. I generally start here http://www.php.net/manual/en/install.windows.iis6.php using the non-thread-safe build of PHP. I don't worry about the fast CGI extensions for my development machine.
2. Your first php script should be:
echo(phpinfo());
This will tell you where the php.ini is as well as which modules have been installed.
3. Make sure you remove old php.ini's from c:\windows and c:\windows\system32 to avoid confusion.
4. If it doesn't work, make sure the virtual directory execute permissions are set to Scripts and Executables if you are using the php-cgi.exe. These need to be set on the virtual directory you are configuring. Make sure mappings are present for this directory as well. I used to set these for the Default Web Site but this is not sufficient.
5. After you have php running, you need to check you can create mySQL databases and connect to them with:
$link = mysql_connect('localhost', 'root', 'password');
if (!$link) {
die('
Could not connect: ' . mysql_error());
}
echo '
Connected successfully';
$dbname = 'TestWordPress';
$db = mysql_select_db($dbname);
echo '
db is '.$db;
mysql_close($link);
phpinfo();