Tweet
Bookmark this on Delicious
The purpose of this tutorial is to show you how to compile PHP from source and install it on your Apache server in order to enable PHP scripting. In case you don't know what PHP is, My Computer Forum features a few tutorials to get you started with PHP. What is more, if you haven't managed to get your Apache server up and running by now, you should have a look at our tutorials about Installing an Apache server on Linux
Before attempting to install PHP on your Apache server, there are a few prerequisites that you must keep in mind:
First step is to get the PHP source code from the PHP website. At the time this Linux tutorial is written, the most current version of PHP is 5.3.7. We will therefore download this version.
Download the file PHP 5.3.7 and unzip its content to your desktop (if you want to be extra safe, you can verify the md5 sum of the zip archive before unzipping it by using the command md5sum).
Next tutorial: Compiling PHP on Linux
Back to computer forums
Installing PHP on an Apache server - Prerequisites
The purpose of this tutorial is to show you how to compile PHP from source and install it on your Apache server in order to enable PHP scripting. In case you don't know what PHP is, My Computer Forum features a few tutorials to get you started with PHP. What is more, if you haven't managed to get your Apache server up and running by now, you should have a look at our tutorials about Installing an Apache server on Linux
Before attempting to install PHP on your Apache server, there are a few prerequisites that you must keep in mind:
- We assume that your Apache server is running on Linux; for the sake of this article, we will be assuming you are running Ubuntu 10 (guess why ;) ?). If such is not the case, you can easily tweak the Linux commands below in order to adapt them to any other Linux platform
-
We also assume that your Apache server has been compiled with the module so (mod_so). This is because we'll be adding PHP as a shared library (.so file) therefore shared libraries must be supported by the server. If you are clueless as to whether this is the case for your server, just run the following command in a Linux terminal window:
apachectl -l
This must return the list of all compiled Apache modules, and mod_so must be one of them. If you receive an error message saying that the apachectl command does not exist, make sure that you give the full path to the command (it might be because it is not part of your PATH environment, if you installed Apache in a non-standard folder) - Obviously, we assume that your Apache server is running fine (try displaying the file index.html just to make sure :))
Installing PHP on an Apache server - Downloading PHP source code
First step is to get the PHP source code from the PHP website. At the time this Linux tutorial is written, the most current version of PHP is 5.3.7. We will therefore download this version.
Download the file PHP 5.3.7 and unzip its content to your desktop (if you want to be extra safe, you can verify the md5 sum of the zip archive before unzipping it by using the command md5sum).
Next tutorial: Compiling PHP on Linux
Back to computer forums
