“We can’t solve problems by using the same kind of thinking we used when we created them.” - Albert Einstein

The opposite of every great idea is another great idea
“We can’t solve problems by using the same kind of thinking we used when we created them.” - Albert Einstein
Installing PHP is a relatively simple task one would think. Indeed it is simple, but configuring the php.ini isn’t; at least not so on Windows Vista! It is infuriating when such a relatively simple task is made inordinately complicated because of the nuances of Vista permissions. What started out as a 5 minute task took a significant number of hours searching for a suitable answer on Google, and not only by myself.
The task I was trying to achieve was the installation of development versions of WordPress, Drupal, MediaWiki and Moodle, all of which would require a MySQL database. Trying to load the MySQL extension should have been a simple case of uncommenting the line in the php.ini and restarting the Apache service. With Vista, this was certainly not the case.
I set up a very simple page detailing the php configuration in an index.php file:
< ?php phpinfo(); ?>
This showed me the default configuration path of my php.ini and extensions directory, amongst a whole host of other information.
In both cases the paths were incorrect. First and foremost the configuration file path stated C:\Windows when in fact I had installed it in the root (C:\PHP5). So, although I was amending the php.ini file with the correct detail, Vista was using the default values. If there is no php.ini file in Windows, then you’ll continue banging your head against a brick wall.
The problems didn’t stop there. Moving the php.ini file to the Windows directory under Vista isn’t a simple copy and paste task. You need to be administrator. But Vista’s administrator priviledges are more pseudo than actual! In order to amend and save the php.ini file in the Windows directory, you must run Notepad as administrator and save the file as such. Voila! Everything then works. The phpinfo() function returned the correct installation detail and I could continue with the job I was meant to be doing.
PS. Thanks to Rob Douglas for his help.
Pre-requisites:
Installing PHP with Apache on Windows Vista is a relatively simple task until you try an configure the settings in php.ini. Problems can occur and stem from the fact that when you install PHP and edit the php.ini file, you need to not only be logged in as Administrator, but run the installer and Notepad text editor as Administrator. The php.ini file also needs to be located in the Windows directory.
Below is an outline of the steps to get your PHP installation running and configured correctly.
C:\PHP5\php.ini
extension_dir = "C:\PHP5\ext" upload_max_filesize = 16M upload_tmp_dir = "C:\PHP5\upload" session.save_path = "C:\PHP5\session"
extension = php_mysql.dll extension = php_mysqli.dll



LoadModule php5_module "C:\PHP5\php5apache2_2.dll" AddType application/x-httpd-php .php AcceptPathInfo on PHPIniDir "C:\Windows"
If there are additional LoadModule lines, remove them, leaving only the one that relates to your version of Apache.
index.php, e.g.:
<ifmodule dir_module> DirectoryIndex index.html index.php </ifmodule>
< ?php phpinfo(); ?>
Browse to the location of the PHP install file e.g.:
C:\Users\Simon\Desktop\
C:\Users\Simon\Desktop\msiexec /i php-5.2.5-win32-installer.msi
And hit the [Enter] button.




C:\Program Files\Apache Software Foundation\Apache2.2\conf\
Click “Next”.




Recent Comments