Sunday, July 17, 2011

Steps: Custom Install PHP 5 on Apache2 server on linux machine

1) Download, php-5.x.x.tar.gz
2) Unpack, -tar xzf php-5.x.x.tar.gz
3) Go to Unpack folder to configure, ./configure --prefix=(PHP5 PATH)/php --with-apxs2=(Apache2 PATH)/bin/axps
Tips: ./Configure -help to look for more options which turn on additional features on your own preference.

4)After configure is done, type:
  1. make
  2. make install

5) Edit httpd.conf,

  1. If cant find then add: Include (PATH)/php5.conf

6) Edit php5.conf,

  1. If cant find then add: AddType application/x-httpd-php .php
  2. Make sure this file had added the following:
    • AddHandler application/x-httpd-php .php
    • DirectoryIndex index.php

7) Make sure php.ini file exist in the correct folder, (PATH)/apache2/php.ini

  1. Search the file by typing: find / -name php.ini

8)Restart your Apache Server.

Additional Setups,
To enable Zip Extension, Edit php.ini,

  1. add the line: extension=zip.so
  2. find zip.so file and make sure the file is executable.
  3. To change zip.so executable, type: chmod +x zip.so **make sure you have root access.
  4. Restart Apache Server.

No comments:

Post a Comment