There is a pre-built PHP 5 binary coming with LSWS, however, you should build your own PHP binary using matching configuration options used by Apache mod_php.

Get a list of compile options (type 'php -i' and look for the line with 'Configure Command ⇒' as shown below:)

root@test ~># php -i
phpinfo()
PHP Version => 5.3.10
...
...
Configure Command =>  './configure'  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-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=/usr/com' '--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-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-system-tzdata' '--with-mhash' \
'--enable-force-cgi-redirect' '--libdir=/usr/lib64/php' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' \
'--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' \
'--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--enable-mysqlnd=shared' \
'--with-mysql=shared,mysqlnd' '--with-mysqli=shared,mysqlnd' '--with-mysql-sock=/var/lib/mysql/mysql.sock' \
'--with-oci8=shared,instantclient,/usr/lib64/oracle/11.2/client64/lib,11.2' \
'--with-pdo-oci=shared,instantclient,/usr,11.2' '--with-interbase=shared,/usr/lib64/firebird' \
'--with-pdo-firebird=shared,/usr/lib64/firebird' '--enable-dom=shared' \
'--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' \
'--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' \
'--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,mysqlnd' \
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--without-sqlite3' \
'--with-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' \
'--with-pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' '--with-tidy=shared,/usr' \
'--with-mssql=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' \
'--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' \
'--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'

Another configure example for PHP 5.4

 '--with-mysqli' '--with-mysql' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbstring' '--with-iconv' '--with-mcrypt' '--enable-pdo' '--with-pdo-mysql' '--with-curl' '--with-litespeed' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-ftp' '--with-openssl' '--with-gettext' '--with-mhash' '--enable-soap'

You may have your existing PHP installed through repository for Apache, hence there is no obvious PHP compile options can be copied over straight away. In this case, you may check your existing PHP configure through phpinfo page and try to match them as much as you can.

Compile PHP from LSWS Admin Console (Actions ⇒ Compile PHP) with mod_php compile options or compile from PHP source code directly.

Note: './configure' needs to be removed when cut and paste to LSWS Admin Console. That is, just cut and paste the options above starting from “'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' …” (remove “Configure Command ⇒ './configure' ”)

If you run into any problem, please check our PHP compilation troubleshooting guide.

  • Admin
  • Last modified: 2018/09/17 18:45
  • by Michael Alegre