Building PHP 5.4 From Source On Debian Squeeze
|
Submitted by MaddinXx (Contact Author) (Forums) on Wed, 2013-03-06 18:15. :: Debian | ISPConfig | Control Panels | PHP
Building PHP 5.4 From Source On Debian Squeeze
Version 1.0.0 This tutorial describes how you can build PHP 5.4 from source on Debian Squeeze. Later on, we will install more modules through PECL and add it as an additional PHP version to ISPConfig's dropdown. At the end you will have a fully function PHP 5.4 installation which is selectable within the ISPConfig interface and a .deb package than can be used on other server as well. I do not issue any guarantee that this will work for you!
1 RequirementsTo follow this tutorial you will need the following:
2 Preliminary NotesI highly recommend to compile the packages on a separate server, since it requires a lot of packages to be installed we don't need otherwise. If you do not have more than one server, it might still be smart to rent a cheap VPS somewhere for a few hours/days. The configure command/parameters we're going to use are as near as possible to the ones that are used to build the regular Debian PHP packages, which are available from the official repositories. Last but not least, most of these information can be found in the ISPConfig Manual - you know what I'm trying to tell you, don't you? ;)
3 Prerequisites(on separate server) Before we can start with the build process, you should install some additional packages. A few of them are just because I like them better (e.g. nano): apt-get -y install nano build-essential checkinstall zip checkinstall will help us to create .deb packages. Check the source from Credits section if you'd like to know more about it.
4 Downloading PHP(on separate server) Before we start downloading and compiling our custom PHP version, we're going to create some directories:
mkdir -p /opt/php/5.4.12 and start downloading the PHP sources as soon as done:
cd /usr/local/src/php5-build Since we need to fetch PHP's dependencies, make sure you have a deb-src line in your /etc/apt/sources.list: nano /etc/apt/sources.list deb-src http://ftp.debian.org/debian squeeze main contrib non-free and update the package cache: apt-get update
5 Building PHP(on separate server) Following the steps above, we prepared our system to be ready to compile. Now, first, we have to fetch/install the dependencies: apt-get build-dep php5 and install a handful other packages: apt-get -y install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev Finally, we are ready to build PHP. As usual, the first step is to fire the configure command. To get a list of all available options, use ./configure --help: ./configure \ If everything went well and you did not get any error messages, continue with: make to actually compile.
6 Creating a package(on separate server) Normally, we would now use make install to install the compiled sources on the system. However, since we'd like to have a .deb file, we make use of the tool checkinstall: checkinstall -D make install Right at the beginning it will ask you to create docs -> choose yes (y) and enter a short summary of your package, e.g.
The following screen allows you to manipulate a lot of other values as well. I recommend to change at least:
Press enter when done. checkinstall will then generate the package for you. The resulting package however is missing the .ini files, so we create a .zip archive: zip /root/php-5.4.12.zip *.deb *.ini-* Done. Great!
7 Installing the packageEverything up to here was done (or should have been done) on it's own server. This part takes place on your ISPConfig system. Make sure you have transfered/copied the resulting .zip file over here. Unzip the archive: unzip php-5.4.12.zip install the package: dpkg -i php-*.deb and copy the .ini files:
cp *.ini-* /opt/php/5.4.12/lib
8 Adding additional modulesOther than the PHP version installed through the package manager of your choice, our custom build will not be able to use modules installed through e.g. apt - but there's an easy alternative. PEAR and PECL are like package managers for PHP - install them: apt-get -y install php-pear and change directory: cd /opt/php/5.4.12/etc
8.1 Installing APC
pecl -C ./pear.conf update-channels Accept default values everywhere. When done, we simply have to add it to our php.ini: nano /opt/php/5.4.12/lib/php.ini extension=apc.so
8.2 Installing uploadprogresspecl -C ./pear.conf install uploadprogress Accept default values everywhere. When done, we simply have to add it to our php.ini: nano /opt/php/5.4.12/lib/php.ini extension=uploadprogress.so
9 Adding PHP to ISPConfigIn ISPConfig 3.0.5, you can configure the new PHP version under System > Additional PHP Versions. On the Name tab, you just fill in a name for the PHP version (e.g. 5.4.12) - this PHP version will be listed under this name in the website settings in ISPConfig: Server: Select the server where the PHP version is installed. Client: If this PHP version should be available for just for one specific client, select that client here. Otherwise, this PHP version will be available for all clients. PHP Name: 5.4.12 Go to the FastCGI Settings tab and fill out the fields as follows: Path to the PHP FastCGI binary: /opt/php/5.4.12/bin/php-cgi Path to the php.ini directory: /opt/php/5.4.12/lib
10 Links / Credits
|



Recent comments
2 days 8 hours ago
2 days 16 hours ago
2 days 19 hours ago
2 days 20 hours ago
2 days 22 hours ago
3 days 19 sec ago
3 days 1 hour ago
3 days 2 hours ago
3 days 18 hours ago
3 days 19 hours ago