In this how to you will learn to compile PHP5 With Bundled Support For GD On Ubuntu.
To install the required packages and download the source code for PHP5:
Install build tools, debian helpers and fakeroot:
#apt-get install build-essential debhelper fakeroot
Source code should reside in /usr/src:
#cd /usr/src
Download PHP source:
#apt-get source php5
Install all packages required to build PHP5:
#apt-get build-dep php5 #cd php5-5.2.3
- Now a package is compiled is set within the files contained in the debian directory of a package.
- Rules for configuring the compile process can be found in debian/rules. In this file there is a line that reads –with-gd=shared,/usr –enable-gd-native-ttf \. This links to the Ubuntu distributed version of LibGD as a shared library.
- It is part of the autoconf script that customises the compilation of PHP. We replaced this line with –with-gd=shared –enable-gd-native-ttf \.
- This causes the compilation process to use the bundled version of GD and make a shared library.
Once the package has been reconfigured it can be compiled and installed by:
Build the php5-* packages:
#dpkg-buildpackage -rfakeroot #cd ..
Now let`s install the new php5-gd package
#dpkg -i php5-gd_5.2.3-1ubuntu6.3_i386.deb Quick restart
#/etc/init.d/apache2 restart
and hey presto, you should be using the bundled version of LibGD for PHP. Hurrah!







