Installing PHP


Current Home :: How to Install and Uninstall -> Installing PHP

Simply enter keywords and click on search button, such as how to install php in apache.
  • Internet

  • Linux Application Installation

  • Server Installation

  • Windows Application Installation

  • Sponsored Link

    :: Installing PHP

    First, extract the PHP package ( php-4.3.10-Win32.zip ). I extracted the package in the directory where Apache was installed ( C:\Program Files\Apache Group\Apache2 ). Change the new created directory name to php ( just to make it shorter ). Then copy the file php.ini-dist in PHP directory to you windows directory ( C:\Windows or C:\Winnt depends on where you installed Windows ) and rename the file to php.ini. This is the PHP configuration file and we'll take a look what's in it later on.

    Next, move the php4ts.dll file from the newly created php directory into the sapi subdirectory. Quoting from php installation file you can also place php4ts.dll in other places such as :

    • In the directory where apache.exe is start from ( C:\Program Files\Apache Group\Apache2 \bin)
    • In your %SYSTEMROOT%\System32, %SYSTEMROOT%\system and %SYSTEMROOT% directory.
      Note: %SYSTEMROOT%\System32 only applies to Windows NT/2000/XP)
    • In your whole %PATH%

    Side Note : Thanks to Shannon Tang for pointing this out

     

     

    Modifying Apache Configuration

    Apache doesn't know that you just install PHP. We need to tell Apache about PHP and where to find it. Open the Apache configuration file in C:\Program Files\Apache Group\Apache2\conf\httpd.conf and add the following three lines :

    LoadModule php4_module php/sapi/php4apache2.dll
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    The first line tells Apache where to load the dll required to execute PHP and the second line means that every file that ends with .php should be processed as a PHP file. You can actually change it to anything you want like .html or even .asp! The third line is added so that you can view your php file source code in the browser window. You will see what this mean when you browse this tutorial and click the link to the example's source code like this one.

    Now restart Apache for the changes to take effect ( Start > Programs > Apache HTTP Server 2.0.50 > Control Apache Server > Restart ) . To check if everything is okay create a new file, name it as test.php and put it in document root directory ( C:\Program Files\Apache Group\Apache2\htdocs ). The content of this file is shown below.

    <?php
    phpinfo();
    ?>

    phpinfo() is the infamous PHP function which will spit out all kinds of stuff about PHP and your server configuration. Type http://localhost/test.php on your browser's address bar and if everything works well you should see something like this :

     

  • Installing MySQL for Jabberd
  • Installing Apache
  • Installing PHP
  • Installing MySQL
  • INSTALLING FIREFOX IN LINUX
  • Installing Firefox for Windows
  • Installing Firefox for Linux
  • Installing Firefox for Mac OS X
  • Installing Firefox 2 on Fedora Core 6
  • Installing Fedora Core from the hard drive
  • :: Installing PHP

    About Us | Advertise | Submit | Your Comment | Privacy | Bookmark anyvista.com
    (C)2006,anyvista.com, how to install applications and digital devices.