Installing PHP Manually on windows.

Bigger organizations in the world of IT have started moving their focus to Open Source Technologies for application development and specifically they are choosing PHP, so the challenges to all the PHP developers are increasing, we can not limit our thinking to small scale or middle scale projects or products, its the time to dive more deeper in the sea and explore the beauty.

Here is a challenge which experienced PHP developers may face in big IT firms.
------------------------------------------------------------------------------------------------------------------------------

Apache server is something which these most of these bigger players are using for supporting JAVA applications, Mysql also have become a known and polular database, Windows machines are still the most favourite for these firms. So you may find this entire receipy available in your organization. Now as a experienced PHP developer when you move in to such setup and are asked to install a setup for php ....wht to do , you cant just install WAMP and have things working on server which is already getting used on different ports by different set ups.

No options except googling out for the solution .... :-( ...here is my sincere effort to help my friends from this situation.

1) Step 1 is Downloading and Installing PHP

  • Dont just go to php.net and download php sorce code , as we are dealing with windows machine look for  windows binaries http://windows.php.net/download/. Downlaod the ziped version as installer version may give you the headache of searching for required libraries/ extension files that you need to have php communicating to apache and mysql.
  • Unzip php    C:\php\
  • Rename C:\php\php.ini-dist it to php.ini
  • Open php.ini file look out for doc_root , change it to your document root location  doc_root = "C:\Program Files\Apache Group\Apache2\htdocs"  Change this line according to your setup.
  • Find out extension_dir and change it to extension_dir = "C:\php\ext"
  • Check if port 80 is available if not change port to some other port by changing "listen: " value in php.ini

2) Step 2 Allow php to communicate with Mysql

  • Check out for the extensions in PHP.ini file , look for mysql extentions and uncomment them
3) Step 3 Inform apache about php's arrival
  •     Open Httpd.conf file and  Add following lines either at the start or at the bottom
        LoadModule php5_module "C:/php/php5apache2_2.dll"
        AddType application/x-httpd-php .php
        PHPIniDir "C:/php"

4) Step 4 Create phpinfo file put in your document root folder , restart your apache and try to hit locahost from url with provided port number and file name and see if you are getting the phpinfo page properly.

    Problems : If while restarting apache you get error , look for apache error log file , trace out the reason it could maninly because of the path the entension directories , if mysql extesion directory path is giving warning there , just check if the required dll is there in the extension folder , if yes then search for libmysql.dll file in your php folder and copy it to system32 in windows folder to have mysql   easily enabled in system path.



   





Comments