Page 1 of 2
Installing PHP on Windows for the first time
Posted: Mon Nov 06, 2006 3:42 pm
by Luke
I am installing PHP5.2.0 on a machine running Windows XP Pro w/out IIS installed (yet). Would you guys recommend installing IIS or apache? I've never installed either of those servers or PHP on any machine ever, so I'm looking for the easiest route, and the only reason I'm installing it is to learn how, so what do you guys think I should do... IIS or apache? What's easier?
Posted: Mon Nov 06, 2006 4:03 pm
by Maugrim_The_Reaper
Apache, it's quite simple to setup and it remains by far the most popular webserver on the net.
Apache has a Window's installer, and editing the httpd.conf file to enable PHP require only two additional lines. If you want a reference installation look up XAMPP to poke at with a stick to see how the configuration files ties together and can be setup.
Posted: Mon Nov 06, 2006 4:10 pm
by Luke
I was leaning towards apache because I don't know where my windows installation CD is and the boss isn't here to find it...
Alright... another question...
I already have apache installed on this machine under
wampserver. If I install apache again in a different directory, should I expect troubles?
Posted: Mon Nov 06, 2006 4:36 pm
by Luke
WOW
That was beyond easy. I've avoided installing PHP on my own for this long?? Man... installing PHP is a breeze. That took me the whole of maybe 30 minutes... and I was working while eating... that was EEEEEEAASY!
Posted: Mon Nov 06, 2006 4:47 pm
by feyd
Installing Apache, MySQL and PHP on Windows is a breeze, with or without the "whole-package" installers. I'm often amazed how many people have a problem installing them.
Posted: Mon Nov 06, 2006 5:02 pm
by Luke
I tried installing Apache 1.3x with PHP 5 a few years back when I first started learning PHP, and I ran into a few problems and gave up. Then I always saw all of the threads in this forum complaining about the difficulty of installation, so I've always put it off and installed w/wampserver. I'm amazed at the ease I just experienced. WOW.
Posted: Mon Nov 06, 2006 5:04 pm
by nickvd
If you install apache (which you really, really should

), and if you plan on running a svn repository, don't install v2.2.x as the windows build of subversion was compiled against 2.0.x so accessing any repository via http(s):// won't be possible. (i was struggling with that problem for weeks/months before I found out why...)
You may also want to check out one of the many wamp-in-a-box bundles, such as
xampp, I use it at work and it makes setting up your dev environment a 5 minute job (php/perl/apache/mysql/ftp and more in one go)...
Posted: Mon Nov 06, 2006 5:07 pm
by Luke
but the point of this exercise was to learn how to install a server & php on a windows machine. Thanks though
Posted: Mon Nov 06, 2006 5:24 pm
by Maugrim_The_Reaper
Windows installation is pretty simple - I think a lot of folk get caught up in the configuration, and often by following out of date tutorials.
Now all you need to do is set things up on Linux

. Not quite so simple I'm afraid...
Posted: Wed Nov 08, 2006 3:38 am
by Luke
Alright... I am trying to install mysql now. I uncommented "extension=php_mysql.dll" in the php.ini file, set the extension_dir directive to the correct path. I added the php directory to the path environment variable, and of course installed mysql. I also restarted apache. Anything I'm forgetting? I'm still getting this error:
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 2
EDIT: Oh yea... it's apache 2.2 php 5.2 and mysql 5.0
Alright... can somebody set me straight here... this is how I understand it. the mysql extension will work with mysql 5.0, but to use all functionality of mysql 5.0 you have to install mysqli extension. Is this correct?
Posted: Wed Nov 08, 2006 4:19 am
by Chris Corbyn
Run phpinfo().... you sure you editted the correct ini file? Copy the ini to C:\WINDOWS\php.ini
Also, double check the dll file is where you expect it to be. Did you install PHP from the zip bundle or the windows installer version? The zip file contains all the DLL files you need

Posted: Wed Nov 08, 2006 10:06 am
by Luke
phpinfo says nothing about mysql. I'm sure I edited the right file, and I know it's changes are taking effect, because I changed the error prefix to show errors in red, and it worked. The dll file is in the right directory and I installed from the zip bundle. I can't for the life of me figure out what is wrong...

Posted: Wed Nov 08, 2006 11:11 am
by nickvd
I had the same problem... try putting the mysql dll files into the windows or the windows/system folder... worked for me!
Posted: Thu Nov 09, 2006 1:18 am
by Luke
nope... that didn't work either. I installed mysql with no problems at work. None at all. I know that php.ini has the directory correct for the extensions, because i enabled gd and a few others and they worked. only mysql is having issues. Anything you guys can think of?
EDIT: nevermind... putting the libmysql.dll file in the WINDOWS directory worked. I wonder why it wouldn't work the other way... could it have to do with my other installation of php? I still have wampserver installed. Could that be it?
Posted: Thu Nov 09, 2006 2:16 am
by timvw
I don't run into that problem (of having to copy libmysql.dll) around since i add the %mysql%/bin directory to my patch...
The other essential thing to do is to add a PHP_RC (or whatever it's name is) to httpd.conf...