Tuesday, August 19, 2014

PHP 5.2.6 + centos 6

Installing PHP from source on CentOS x86_64 (w/ apache)

Installing PHP from source is much easier than most people think. In this tutorial I will describe how to install a bare PHP build with mysql/mysqli support in addition to configuring apache to interpret PHP scripts.

Compiling PHP Source

Alright, well in order to compile the php source code you must first have gcc install (# yum install gcc). Also if you want to be able to use PHP in apache then you need to have httpd and httpd-devel packages installed. Here is how I did my install. (Please note that I used PHP 5.2.6 for my install, but this will work with just about any php version, just be sure to untar and cd into the proper directory for your version of php.)
You’re also going to want to place a php.ini into /etc/php.ini and make the /etc/php.d directory if you have not done so already.

Installing PHP into apache

To install PHP into apache all you need to do is place the following configuration file in /etc/httpd/conf.d/php.conf.
Finalizing our install is fairly simple, just restart apache by typing the following command and you should be good to run PHP applications for the web.

No comments:

Post a Comment