Quick and Dirty setup of Apache-PHP
Everytime I had to code in a new PC I had to end up installing PHP, Apache and MySQL all over again… ahh the drawback of flying solo and not having a central server for coding… hehehe… and everytime I had to pull out the PHP manual and read all over again how to install it (yup, it’s not stock knowledge and hopefully Kris Aquino won’t ask me this whenever I get on Game Ka Na Ba)
I remembered creating a manual for this at work in order to make the new guys job easier, but since it’s considered company property, it’s not something that I could bring out… then again, it could have been something I just wrote on notepad and emailed to everybody because I didn’t want to go through the motions of filing a proper document… hehehe
So in order to make my next installation job easier, I’ll create this little how-to…. You can just go ahead and read the Bold text from here on as the rest are just tidbits that can be considered as useful information.
This is on the assumption that you are using Windows NT platform and it’s variants(W2K or XP)… Win 98 & ME aren’t stable environments and they can lead to PHP behaving very peculiarly… while Linux might just be a tad too difficult for a beginner to install at.
1. Download Apache binaries at the Apache Foundation and install in drive C: (installing in default drives may not be challenging for some geeks, but heck time is precious for an old geezer like me)
2. Download PHP
I’d recommend version 4 as this is what’s being used commonly in the web right now. Extract the files to drive c:\php (again to make it easier for you to get up to speed by using the default drives)
copy the file php4ts.dll found in c:\php\ to c:\windows\system32
copy php.ini file to c:\windows
open the c:\program files\apache group\apache\conf\httpd.conf file, this is the apache web servers configuration file.
Append on the last line
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php .phtml
this tells apache to process all .php files as files that should be parsed by PHP. restart your apache web server. If apache fails to start check that php4apache.dll exists in c:/php/sapi/
3. Download the manual from PHP for next steps
Choose and Download an IDE editor… courtesy of MrAnderson of PHPUGPH.com
Create a test.php file using notepad or the IDE you just downloaded. Input in that file
< ?php
echo phpinfo();
?>
Save the php files in c:\program files\apache group\apache\htdocs and you are good to go.
Open open up your web browser and type in the link
http://localhost/test.php
You should get a screen with some cool PHP information about your system with the color of PHP.net
To be continued is the setup of mysql and porting it to PHP….
[source]