LSWS PHP LSAPI Build Troubleshooting Guide
LSWS PHP LSAPI Build Troubleshooting Guide
Preamble
This document log error messages during the php build stage for LiteSpeed Web Server
(LSWS) and their relevant fixes. The general PHP/LSAPI build procedures are described
in PHP 4/5 with LSAPI Compile/Install How-To. As of this writing, the latest php 5.2.16 is
out. The latest LSAPI is at version 5.5. We will use php 5.2.16 and LSAPI 5.5 as an
example to build LSPHP.
Procedures
1. Pre-requisites
Make sure all the build tools are installed and ready: patch, gcc, glibc, libstdc++, gcc-c+
+, binutils, libtool, autoconf, make
CentOS:
yum install patch gcc glibc libstdc++ gcc-c++ binutils libtool
autoconf make
CentOS (64bit): yum install patch.x86_64 gcc.x86_64 glibc.x86_64 libstdc+
+.x86_64 gcc-c++.x86_64 \
binutils.x86_64 libtool.x86_64 autoconf.x86_64 make.x86_64
Ubuntu (32bit or 64bit): apt-get install patch gcc glibc libstdc++ gcc-c++
binutils libtool autoconf make
2. Download PHP source and unpack it
# wget -N http://us2.php.net/get/php-5.2.16.tar.gz/from/us.php.net/mirror
# tar -zxf php-5.2.16.tar.gz
3. Download LSAPI source and unpack it
# cd php-5.2.16/sapi
# wget -N http://www.litespeedtech.com/packages/lsapi/php-litespeed-5.5.tgz
# tar -zxf php-litespeed-5.5.tgz
Note: LSAPI 5.5 is shipped with PHP source from PHP 5.3 onward. This step can be
skipped if you build PHP 5.3 or above.
4. cd to php source directory and rebuild configure script
# cd ..
# touch ac*
# ./buildconf --force
CentOS (64bit):
Error Message:
buildconf: autoconf not found.
You need autoconf version 2.13 or newer installed
to build PHP from CVS.
make: *** [buildmk.stamp] Error 1
or
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
Cause: Missing 'autoconf' program in the build system.
Fix: Install 'autoconf' program.
CentOS: yum install autoconf(.x86_64)
Ubuntu (32bit or 64bit): apt-get install autoconf
Error Message:
Forcing buildconf
export PHP_AUTOCONF=/usr/bin/autoconf-2.13
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13
Configure/Compilation
4. Configure/Compile PHP with LSAPI (LSPHP)
#
'./configure'
libdir=lib64' \
'--prefix=/lsphp5'
'--with-litespeed'
'--with-
'--
'--without-sqlite'
'--with-system-tzdata' '--enable-force-cgi-redirect'
with-imap=shared' '--with-imap-ssl' \
'--with-
'--enable-pcntl'
'--
'--enable-mbstring=shared' '--enable-mbregex'
with-gd=shared' '--enable-bcmath=shared' \
'--enable-dba=shared' '--with-db4=/usr'
ldap=shared' '--with-ldap-sasl' \
'--with-ncurses=shared'
'--with-xmlrpc=shared'
'--
'--with-
'--with-
'--with-mcrypt=shared,/usr'
'--with-mhash=shared,/usr'
'--withtidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-sysvmsg=shared' \
'--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared'
'--with-unixODBC=shared,/usr'
Note:
it saves quite a bit of time to get all needed packages installed in one shot
instead of going through each error and fix them. For the example compile
options above, just issue the following command to get all the needed
packages installed.
CentOS 5:
yum install libxml2-devel openssl-devel bzip2-devel curl-devel
libjpeg-devel libpng-devel libXpm-devel \
db4-devel
recode-devel
net-snmp-devel
libtidy-devel
libxslt-devel
bzip2-devel.x86_64
freetype-
libmcrypt-devel.x86_64
readline-devel.x86_64
recode-
db4-
recode-devel
net-snmp-devel
libtidy-devel
libxslt-devel
CentOS 6 x86_64:
yum install libxml2-devel.x86_64 openssl-devel.x86_64
libcurl-devel.x86_64 db4-devel.x86_64 \
bzip2-devel.x86_64
freetype-
libmcrypt-devel.x86_64
readline-devel.x86_64
recode-
unixODBC-dev
libldap2-dev
postgresql-
db4-
recode-devel
net-snmp-devel
libtidy-devel
libxslt-devel
OpenSUSE x86_64:
zypper install libxml2-devel.x86_64 openssl-devel.x86_64 bzip2-devel.x86_64
libcurl-devel.x86_64 db4-devel.x86_64 \
libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64
devel.x86_64 gmp-devel.x86_64 \
libc-client-devel.x86_64
openldap-devel.x86_64
mhash-devel.x86_64 freetds-devel.x86_64 \
freetype-
libmcrypt-devel.x86_64
readline-devel.x86_64
recode-
Error Message:
Can not make
Cause: Program 'make' is missing on the building server.
Fix: Install 'make' program
CentOS: yum install make
CentOS(64bit): yum install make.x86_64
Ubuntu: apt-get install make
Error Message:
Could not find xml2-config
Cause: configure option 'with-libxml-dir=/usr' used BUT package libxml2-devel is
missing.
Fix: Install 'libxml2-devel' package
CentOS: yum install libxml2-devel
CentOS(64bit): yum install libxml2-devel.x86_64
Ubuntu: apt-get install libxml2-devel
Error Message:
Could not find evp.h
Cause: configure option 'with-openssl' used BUT package openssl-devel(.x86_64)
is missing .
Fix:
CentOS: yum install openssl-devel
CentOS(64bit): yum install openssl-devel.x86_64
Error Message:
checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
Cause: configure option 'with-bz2' used BUT bzip2-devel(.x86_64) is missing.
Fix:
Error Message:
checking for cURL support... yes, shared
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution easy.h should be in <curl-dir>/include/curl/
**ERROR** Could not configure PHP build
Cause: configure option
package is missing
'with-curl=shared,/usr'
used but
Fix:
CentOS: yum install curl-devel
CentOS(64bit): yum install curl-devel.x86_64
CentOS 6: yum install libcurl-devel
CentOS 6(64bit): yum install libcurl-devel.x86_64
Ubuntu: apt-get install libcurl3-dev
curl-devel(.x86_64)
Error:
configure: error: DBA: Could not find necessary header file(s).
**ERROR** Could not configure PHP build
Cause: configure with option 'enable-dba=shared' 'with-db4=/usr' one of DB library
packages (DB4) is missing
Fix:
CentOS: yum install db4-devel
CentOS(64bit): yum install db4-devel.x86_64
Ubuntu: apt-get install libdb4.4-dev
Error Message:
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.
**ERROR** Could not configure PHP build
Cause: configure with
package is missing
option
'with-jpeg-dir=/usr' but
libjpeg-devel(.x86_64)
Fix:
CentOS: yum install libjpeg-devel
CentOS(64bit): yum install libjpeg-devel.x86_64
Ubuntu: apt-get install libjpeg-dev
Error Message:
configure: error: libpng.(a|so) not found.
**ERROR** Could not configure PHP build
Cause: configure
with
package is missing
option
'with-png-dir=/usr' but
Fix:
CentOS: yum install libpng-devel
libpng-devel(.x86_64)
Error Message:
configure: error: libXpm.(a|so) not found.
**ERROR** Could not configure PHP build
Cause: configure with 'with-xpm-dir=/usr' but libXpm-devel(.x86_64) package is
missing
Fix:
CentOS: yum install libXpm-devel
CentOS(64bit): yum install libXpm-devel.x86_64
Ubuntu: apt-get install libXpm-dev
Error Message:
configure: error: freetype.h not found.
**ERROR** Could not configure PHP build
Cause: configure
with
package is missing
'with-freetype-dir=/usr' but
freetype-devel(.x86_64)
Fix:
CentOS: yum install
freetype-devel
freetype-devel.x86_64
Error Message:
configure: error: Your
Please reinstall it.
t1lib
distribution
is
not
installed
correctly.
with
'with-t1lib=/usr' but
t1lib-devel(.x86_64)
package
is
Fix:
CentOS: yum install
t1lib-devel
t1lib-devel.x86_64
Error Messages:
configure: error: Unable to locate gmp.h
**ERROR** Could not configure PHP build
Cause: configure with 'with-gmp' but gmp-devel(.x86_64) package is missing
Fix:
CentOS: yum install
gmp-devel
gmp-devel.x86_64
Error Message:
checking for U8T_DECOMPOSE...
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is
missing.
This should not happen. Check config.log for additional information.
Cause: configure
with
'with-imap=shared'
devel(.x86_64) package is missing
'with-imap-ssl'
Fix:
CentOS: yum install
libc-client-devel
libc-client-devel.x86_64
Error Message:
checking for LDAP support... yes, shared
checking for LDAP Cyrus SASL support... yes
but
libc-client-
'with-ldap-sasl' but
openldap-
Fix:
CentOS: yum install
openldap-devel
openldap-devel.x86_64
Error Message:
checking for mcrypt support... yes, shared
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Cause: configure with
package is missing
'with-mcrypt=shared,/usr' but
libmcrypt-devel(.x86_64)
Fix:
CentOS: yum install
libmcrypt-devel
libmcrypt-devel.x86_64
Error Message:
checking for mhash support... yes, shared
configure: error: Please reinstall libmhash - I cannot find mhash.h
Cause: configure with
package is missing
'with-mhash=shared,/usr' but
Fix:
CentOS: yum install
libmhash-devel
libmhash-devel.x86_64
mhash-devel
mhash-devel.x86_64
libmhash-devel(.x86_64)
Error Message:
checking for MSSQL support via FreeTDS... yes, shared
configure: error: Directory /usr is not a FreeTDS installation directory
Cause: configure with option 'with-freetype-dir=/usr' but freetds-devel(.x86_64)
package is missing
Fix:
CentOS: yum install
freetds-devel
freetds-devel.x86_64
Error Message:
configure: error: Cannot find libz.
**ERROR** Could not configure PHP build
Cause: configure with 'with-zlib' but libz-devel(.x86_64) package is missing
Fix:
CentOS: yum install
libz-devel
libz-devel.x86_64
zlib-devel
zlib-devel.x86_64
Error Message:
configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Cause: configure with 'with-mysql=shared,/usr' but mysql-devel(.x86_64) package
is missing
Fix:
CentOS: yum install
mysql-devel
mysql-devel.x86_64
Error Message:
checking for ncurses support... yes, shared
not found
configure: error: Please reinstall the ncurses distribution
Cause: configure with 'with-ncurses=shared' but ncurses-devel(.x86_64) package
is missing
Fix:
CentOS: yum install
ncurses-devel
ncurses-devel.x86_64
Error Message:
checking for pcre support... yes, shared
not found
configure: error: pcre.h not found
Cause: configure with 'with-pcre=shared,/usr' but pcre-devel(.x86_64) package is
missing
Fix:
CentOS: yum install
pcre-devel
pcre-devel.x86_64
Error Message:
checking for Oracle (OCI8) support... no
checking for unixODBC support...
'/usr/include/sqlext.h' not found!
configure:
error:
ODBC
header
file
unixODBC-devel
unixODBC-devel.x86_64
Error Message:
checking for PostgreSQL support for PDO... yes, shared
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL
installation path
Cause: configure with 'with-pdo-pgsql=shared,/usr' but postgresql-devel(.x86_64)
package is missing
Fix:
CentOS: yum install
postgresql-devel
postgresql-devel.x86_64
postgresql-server-dev-8.3
(aptitude
search
Error Message:
checking for sqlite3 files in default path... not found
configure: error: Please reinstall the sqlite3 distribution
Cause: configure with
package is missing
'with-pdo-sqlite=shared,/usr' but
Fix:
CentOS: yum install
sqlite-devel
sqlite-devel.x86_64
Error Message:
sqlite-devel(.x86_64)
aspell-devel
aspell-devel.x86_64
Error Message:
checking for readline support... yes
configure: error: Please reinstall readline - I cannot find readline.h
Cause: configure with 'with-readline' but readline-devel(.x86_64) package is
missing
Fix:
CentOS: yum install
readline-devel
readline-devel.x86_64
Error Message:
checking for recode support... yes, shared
configure: error: Can not find recode.h anywhere under /usr /usr/local /usr
/opt.
Cause: configure
with
package is missing
'with-recode=shared,/usr' but
Fix:
CentOS: yum install
recode-devel
recode-devel.x86_64
recode-devel(.x86_64)
Error Message:
checking for init_snmp in -lsnmp... no
configure: error: SNMP sanity check failed. Please check config.log for
more information.
Cause: configure with
package is missing
'with-snmp=shared,/usr' but
net-snmp-devel(.x86_64)
Fix:
CentOS: yum install
net-snmp-devel
net-snmp-devel.x86_64
Error Message:
checking for TIDY support... yes, shared
configure: error: Cannot find libtidy
Cause: configure with 'with-tidy=shared,/usr' but libtidy-devel(.x86_64) package
is missing
Fix:
CentOS: yum install
libtidy-devel
libtidy-devel.x86_64
Error Message:
checking for XSL support... yes, shared
configure: error: xslt-config not found. Please reinstall the libxslt >=
1.1.0 distribution
Cause: configure with 'with-xsl=shared,/usr' but libxslt-devel(.x86_64) package is
missing
Fix:
CentOS: yum install
libxslt-devel
libxslt-devel.x86_64
libxslt-dev
Error Message:
configure: error: recode extension can not be configured together with:
imap mysql
Cause: For php 5.2.9 or later, this is because php-5.2.8-recode.patch isn't applied to
php package.
Fix: edit file php_source_root/ext/recode/config9.m4, remove the following lines:
test "$PHP_IMAP"
Error Message:
checking for libedit readline replacement... yes
configure: error: Please reinstall libedit - I cannot find readline.h
Cause: configure with 'with-libedit', however, libedit-devel package is missing
Fix:
CentOS: yum install libedit-devel
CentOS64: yum install libedit-devel.x86_64
Ubuntu: apt-get install libedit-dev
Error Message:
/usr/bin/ld: cannot find -lltdl
Cause: system is missing libltdl.so
Fix:
CentOS: yum install libtool-ltdl-devel
CentOS64: yum install libtool-ltdl-devel.x86_64
Ubuntu: apt-get install libtool-ltdl-dev
Show pagesource
Old revisions
Login
Sitemap
COMPANY
About
Careers
Contact Us
SUPPORT
Forum
Wiki
Documentation
STAY CONNECTED
RSS
Copyright 2013-2014 Lite Speed Technologies Inc. All Rights Reserved. (Privacy Policy)