Last active
September 3, 2015 10:54
-
-
Save dgoguerra/32e7b652c4de85789f3a to your computer and use it in GitHub Desktop.
Compile PHP 5.5.28 from source in CentOS 6.5 to be used on Plesk 11.5. Based on http://kb.odin.com/en/118378
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download source | |
cd /usr/local/src/ | |
wget http://fr2.php.net/get/php-5.5.28.tar.bz2/from/this/mirror --output-document="php-5.5.28.tar.bz2" | |
# Untar to php-5.5.28/ | |
tar xjvf php-5.5.28.tar.bz2 | |
yum install libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel \ | |
libpng-devel freetype-devel gmp-devel mysql-devel ncurses-devel unixODBC-devel \ | |
net-snmp-devel mhash-devel libc-client-devel libicu-devel gcc postgresql-devel \ | |
aspell-devel libxslt-devel gcc-c++ openldap-devel | |
# Configure build. Added --enable-zip option to the command taken from http://kb.odin.com/en/118378 ! | |
cd /usr/local/src/php-5.5.28 | |
./configure '--with-libdir=lib64' '--cache-file=../config.cache' \ | |
'--prefix=/usr/local/php-5.5.28-cgi' '--with-config-file-path=/usr/local/php-5.5.28-cgi/etc' \ | |
'--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' \ | |
'--with-freetype-dir=/usr/local/php-5.5.28-cgi' '--with-png-dir=/usr/local/php-5.5.28-cgi' \ | |
'--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' \ | |
'--with-jpeg-dir=/usr/local/php-5.5.28-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' \ | |
'--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' \ | |
'--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' \ | |
'--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php-5.5.28-cgi' \ | |
'--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' \ | |
'--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' \ | |
'--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' \ | |
'--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php-5.5.28-cgi/pear' '--enable-intl' \ | |
'--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php-5.5.28-cgi/php.d' '--enable-cgi' \ | |
'--enable-zip' | |
# Compile | |
make | |
# Install | |
make install | |
# Setup php.ini | |
cp php.ini-development /usr/local/php-5.5.28-cgi/etc/php.ini | |
#cp php.ini-production /usr/local/php-5.5.28-cgi/etc/php.ini | |
# Restore SELinux contexts | |
restorecon -R /usr/local/php-5.5.28-cgi | |
# Register the new PHP version in Plesk | |
/usr/local/psa/bin/php_handler --add \ | |
-displayname 5.5.28-custom \ | |
-path /usr/local/php-5.5.28-cgi/bin/php-cgi \ | |
-phpini /usr/local/php-5.5.28-cgi/etc/php.ini \ | |
-type fastcgi \ | |
-id fastcgi-5.5.28 | |
# List registered PHP versions | |
#/usr/local/psa/bin/php_handler --list | |
# Unregister from Plesk, if needed | |
#/usr/local/psa/bin/php_handler --remove -id fastcgi-5.5.28 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment