No announcement yet.

Compile php


Unconfigured Ad Widget

  • Filter
  • Time
  • Show
Clear All
new posts

  • Compile php

    First you need to check whether php is compiled or not.

    # php -m

    Above command will provide you installed version of php. If you want to upgrade it then you need to download the source from the URL:

    or use try the below mentioned steps:

    # cd /usr/src

    # wget

    # tar -zxvf php-4.3.3.tar.gz

    # cd /usr/src/php-4.3.3

    # ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql

    Note: A '/usr/local/apache/bin/apxs' the path of this apache extension binary may not be the same you need to set it as per your server configuration.
    You can add other prefix and options for php extension like GD and other while compiling it.

    # make

    # make test

    # make install

    You need to make some changes to work php with Apache, hence need to change the httpd.conf apache configuration file. Open this file with vi editor in insert mode.

    If LoadModule php4_module modules/ line is not added by php install to httpd.conf, then you have to add it yourself. Add it somewhere below section named "Dynamic Shared Object (DSO) Support"

    LoadModule php4_module modules/

    Now, add this line to httpd.conf file:

    AddType application/x-httpd-php .php

    Lastly restart your apache server.

    Now create a test PHP file using any text editor and add these lines to it:
    Last edited by admin; 08-05-2015, 05:34 AM.

  • #2
    Re: Compile php

    Its great if you also provide us steps to compile php with both veriosn php4 and php5 it will be great help