Categorized | News

Installing PHP from scratch – Linux

Posted on 16 December 2001 by Demian Turner

And now for the standard "installing PHP from scratch" tuturial, no website would be complete without it. In fact, when I did this last week I had to search around for ages for the various information, so here follows a step-by-step list that aims to save you the hassle. Lines starting with a # denote comments, everything else must be typed as it appears.

Before we continue, note the following: for the install to work properly you need to *do everything as root*. And in the order outlined below :-). Also, it is good practice to put all your downloaded files in a standard place, people generally use /usr/local/src/

Bookmark and Share

3 Comments For This Post

  1. demian Says:

    Every time I install php on a new machine it\’s always been long enough to have forgotten which dlls to copy across, which lines to add to httpd.conf 😉

    And every time it\’s a matter of wading through the 4,634 words of the clumsy install.txt that comes with the distro. So here\’s the skinny:

    1. install apache
    2. copy php files to C:\\php
    3. copy php4ts.dll to %SYSTEMROOT%\\system32
    4. copy the following lines into httpd.conf:

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

    5. add index.php to the DirectoryIndex directive

    start apache and you\’re in business.

  2. demian Says:

    and here’s the equivalent for PHP5.x

    1. install apache2 via installer
    2. copy php files to C:/php5
    3. copy php5ts.dll to C:/Program Files/Apache Group/Apache2/bin
    4. copy the following lines into httpd.conf:

    LoadModule php5_module “c:/php5/php5apache2.dll”
    AddType application/x-httpd-php .php
    PHPIniDir “C:/php5”

    5. rename php.ini-dist to php.ini and leave it in C:/php5
    6. add index.php to the DirectoryIndex directive
    7. copy C:/php5/libmysql.dll to C:/WINNT/system32
    8. in php.ini, uncomment
    9. in php.ini, assign the value “c:/php5/ext” to the directive “extension_dir”

    start apache and you’re in business

  3. Isaac Says:

    How do I reinstall php5 with curl mod. PHP5 has been installed on this production server without curl. Somebody help plz

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up