ChrisCodes.com

Tips for PHP development on Windows

PHP can be very confusing at first, especially for those coming from a Windows environment. Here's a few simple tips to get PHP running on Windows smoothly.
First, if possible, run it on Apache.
Yes it can run on IIS, but I have seen wierd things happen. If your production server is Apache, then definitely use Apache, as that will keep things simple when you upload your scripts.
PHP.INI file
I've read numerous articles, all of which seem to state different things when it comes to where to place the php.ini file. I suppose different places work on different OS's, but I've found it's best to just place it right in the Apache root directory.
For example, if I installed Apache to C:\\Apache, then I'd place my php.ini file in C:\\Apache. Simple enough!
I've also found it to work in the main Windows directory (C:\\WINDOWS on XP, C:\\WINNT on 2000), but not in the system32 directory as some recommended.
If you plan on using sessions, you'll need to change the path where temp files are stored. Search for
session.save_path
and change it from
session.save_path = /tmp
to
session.save_path = C:\\WINDOWS\\Temp

I'll update this as I find out more Windows PHP specifics. If anyone has anything I should add, email me.

Chris keyed this in on: 2004-01-05
Filed in: Apache, PHP, Web Development, Windows

Feed Icon

Copyright © 2008 Chris Martin