Manually Building PHP
There are times that you wanted to install a specific version of PHP but ended up scratching your head since your favorite repositories doesn't support your desired version anymore. I know that feeling. Here's how you can install your desired PHP version without having to rely on repositories.
Shout out to my colleague Tope for this helpful tut.
- Download compressed package of the PHP version that you want to install on PHP's Website.
- Extract the package.
- Change working directory to the directory of the extracted package
- Run ./configure ( you can add or modify other PHP extensions by specifying additional options to the ./configure script Ex. ./configure --enable-zip --enable-bcmath and so on )
- Run make
- Run make test (Optional)
- Run make install
Extensions need for SugarCRM 7 to run. Please disregard since this is for OP's purpose only
./configure --build=x8664-redhat-linux-gnu --host=x8664-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --enable-gd-native-ttf --with-t1lib=/usr --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pcre-regex --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --with-kerberos --enable-ucd-snmp-hack --enable-shmop --enable-calendar --with-libxml-dir=/usr --enable-xml --with-mhash --with-apxs2=/usr/sbin/apxs --libdir=/usr/lib64/php --with-mysql --with-mysqli --with-gd --disable-dom --disable-dba --without-unixODBC --disable-phar --disable-fileinfo --without-pspell --disable-wddx --disable-posix --disable-sysvmsg --disable-sysvshm --disable-sysvsem --enable-bcmath --with-curl --with-imap --with-imap-ssl --enable-mbstring --enable-soap --enable-zip
Using the above extensions, you are going to encounter errors. Most of them are caused by missing libraries. Install corresponding libraries first and run configure script again.
Written by Vincent
Related protips
Have a fresh tip? Share with Coderwall community!
PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.
Security insights from Cside