Download and install PHP in Linux

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



PHP SDKPHP is designed to run either from the command line by executing the php command, or through a web server (e.g. Apache). A guide to installing PHP on Unix (incl. linux) based systems can be found on the PHP documentation page. The summary below is a short summary of these instructions for Apache 1.x and 2.x.


Apache 1.x


The general summary for install with Apache 1.x:

Download the current PHP source from http://www.php.net/

./configure --with-apxs --with-mysql
make
make install

cp php.ini-dist /usr/local/lib/php.ini

Now edit your Apache config file and add:

For PHP 4:
  LoadModule php4_module libexec/libphp4.so
  AddModule mod_php4.c
For PHP 5:
  LoadModule php5_module libexec/libphp5.so
  AddModule mod_php5.c
For both:
  AddType application/x-httpd-php .php .phtml

Now restart Apache:

  apachectl graceful

Apache 2.x


./configure --with-apxs2 --with-mysql
make
make install

cp php.ini-dist /usr/local/lib/php.ini

Now edit your Apache config file and add:

For PHP 4:
  LoadModule php4_module libexec/libphp4.so
For PHP 5:
  LoadModule php5_module libexec/libphp5.so
For both:
AddType application/x-httpd-php .php .phtml

Now restart Apache:

  apachectl graceful

Distribution specific installs


Your distribution may also contain a native version of PHP that you can install with utilities such as yum, up2date, apt-get or emerge (depending on your distribution). There will usually also be packages to install extensions (e.g. MySQL integration) that you may also need.

Attachments

    Outcomes