Sunday 21 April 2013

PHP installation


     What Do I Need?

       To start using PHP, you can:
  • Find a web host with PHP and MySQL support
  • Install a web server on your own PC, and then install PHP and MySQL

Use a Web Host With PHP Support

Ø If your server has activated support for PHP you do not need to do anything.
Ø Just create some .php files, place them in your web directory, and the server will automatically parse them for you.
Ø You do not need to compile anything or install any extra tools.
Ø Because PHP is free, most web hosts offer PHP support.

  
Installing PHP

This part is fairly easy, the PHP homepage is php.net, you can download the CGI executable, or the ISAPI DLL's for PWS and IIS. But we won't be downloading from php.net. Go to php4win.de and download PHP 4.04. This file is quite big too. So, again, be patient. Now, unzip the file to C:\php.

Stop Apache, if it isn't already. Copy php4ts.dll to the Windows\System directory. In httpd.conf search for #LoadModule it should bring you to a list of modules that can be loaded. Leave those alone, but directly under them, add these lines:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

Now, write a file called test.php, with this as the content: 

<?php
echo "PHP Rules!";
?>

Save the file, and put it into the directory you set as the document root. You set that up above. Now start up Apache, and type this into the location bar of your favorite web browser: 

http://localhost/test.php

If all goes well, you should get a lovely:

PHP Rules!
...on the screen.. 

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More