building PHP 5.3 on fedora 18/19/20

Fedora 18 is out, and while awesome comes packaged with PHP 5.4 only. I have some older webapps (Drupal 6) which are somewhat incompatible. So we have to build from scratch.

Another alternative is ZendServer CE, which provides architecture independent RPMs, but that isn’t yet built for the version of Apache that comes with Fedora 18 (Apache 2.4)

Make sure to install the libraries that PHP needs to build

yum install pcre-devel ncurses-devel httpd-devel mysql-devel zlib-devel libcurl-devel readline-devel mysql-connector-c++-devel openssl-devel libjpeg-turbo-devel libxml2-devel libpng-devel freetype-devel libmcrypt-devel

Grab the source from PHP.net and extract it. This configure command should get you the PHP you are used to.


'./configure' '--prefix=/usr' '--disable-debug' '--enable-inline-optimization' '--enable-libxml' '--enable-session' '--enable-xml' '--enable-hash' '--with-pear' '--with-apxs2' '--with-layout=GNU' '--enable-filter' '--with-pcre-regex' '--with-zlib' '--enable-simplexml' '--enable-dom' '--with-openssl' '--enable-pdo' '--with-pdo-sqlite' '--with-readline' '--with-iconv' '--with-sqlite3' '--enable-xmlwriter' '--enable-xmlreader' '--with-config-file-scan-dir=/etc/php.d' '--with-mysql=/usr' '--with-libdir=lib64' '--with-pdo-mysql' '--with-gd' '--with-curl' '--enable-zip' '--enable-mbstring' '--enable-soap' '--with-mcrypt' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/lib64' '--with-mysqli' '--with-jpeg-dir=/usr/lib64' '--with-config-file-path=/etc'

make, and make install