[solved] PHP won't install

#1
Hello,

After trying unsuccessfully, I'm unable to find a solution to recompile PHP 5.3.16 on LiteSpeed.

I'm not using a Control Panel or Apache (For Config Files)

I've successfully compiled this before when we were running MySQL 5.1 - but now after the upgrade apparently doesn't want to compile at all.

Actually all I'm trying to add is FreeType Support with GD, I know the configuration to add and this isn't the issue.

Code:
--with-freetype-dir=/usr
This is from phpinfo()

Code:
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-bz2' '--with-curl=shared,/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/usr' '--with-mysql=/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--with-openssl' '--with-openssl-dir=/usr' '--with-pic' '--with-png-dir=/usr' '--with-tidy=shared,/usr' '--with-xmlrpc=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config'
This is what I'm adding to the LiteSpeed PHP Install:

Removed: './configure' '--prefix=/usr/local/lsws/lsphp5'
Added: '--with-freetype-dir=/usr'

Code:
'--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-bz2' '--with-curl=shared,/usr' '--with-freetype-dir=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/usr' '--with-mysql=/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--with-openssl' '--with-openssl-dir=/usr' '--with-pic' '--with-png-dir=/usr' '--with-tidy=shared,/usr' '--with-xmlrpc=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config'
The Errors and Logs:

Full Log can be found at: http://pastie.org/pastes/5696964/text
Code:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.
**ERROR** Could not configure PHP build
Full log can be found at: http://pastie.org/pastes/5697031/text
Code:
cat /usr/local/lsws/phpbuild/php-5.3.16/config.log

configure:60660: checking for mysql_error in -lmysqlclient
configure:60679: gcc -o conftest -I/usr/include -g -O2 -fvisibility=hidden  -L/usr/lib64  -Wl,-rpath,/usr/lib6464 -L/usr/lib6464 -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient  -lz -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lbz2 -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz 1>&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60668 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }
If you notice:
Code:
/usr/bin/ld: cannot find -lmysqlclient
Code:
[root@server15 etc]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
Then:

Code:
[root@server15 etc]# ls /etc/ld.so.conf.d/
kernel-2.6.32-220.13.1.el6.x86_64.conf
kernel-2.6.32-279.11.1.el6.x86_64.conf
qt-x86_64.conf
kernel-2.6.32-220.7.1.el6.x86_64.conf
kernel-2.6.32-279.9.1.el6.x86_64.conf
kernel-2.6.32-220.el6.x86_64.conf
libmysqlclient15-x86_64.conf
The file we should read:

Code:
[root@server15 etc]# cat /etc/ld.so.conf.d/libmysqlclient15-x86_64.conf
/usr/lib64/mysql
I did use: ldconfig to update it, no results.

After researching I've been unable to find a solution to get this PHP to compile.

I've tried changing this the configure config:

Code:
--with-mysql=/usr --with-mysqli=shared,/usr/lib64/mysql/mysql_config
Code:
--with-mysql --with-mysqli
Code:
--with-mysql=mysqlnd --with-mysqli=mysqlnd
Read somewhere that could of been because it needed 32bit MySQL, so I tried installing it. (Running x64) Obviously, No go. (32 Bit version, No longer installed.)

uname -a (CentOS 6)
Linux 2.6.32-279.11.1.el6.x86_64 #1 SMP Tue Oct 16 15:57:10 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

MySQL 5.5 x64

Any assistance would be greatly appreciated.

Regards,
Cory
 
Last edited by a moderator:
#3
how about remove "--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config" ?
Even if that did work, I need pdo-mysql as it's required my a control panel I use.

For sake of testing:

I did:

Code:
--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config
AND

Code:
--with-pdo-mysql
AND

Code:
Removed It.
Same Result...
 
#5
what's current options (from phpinfo) ?
Current:

Code:
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-bz2' '--with-curl=shared,/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/usr' '--with-mysql=/usr' '--with-mysqli=shared,/usr/lib64/mysql/mysql_config' '--with-openssl' '--with-openssl-dir=/usr' '--with-pic' '--with-png-dir=/usr' '--with-tidy=shared,/usr' '--with-xmlrpc=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config'
All I'm trying to add:

Code:
--with-freetype-dir=/usr
With the current config, I tried just running that and I get the same error as I do now.

Also:

Code:
[root@server15 bin]# rpm -qa|grep -i mysql
MySQL-python-1.2.3-0.3.c1.1.el6.x86_64
perl-MySQL-Config-1.04-1.el6.rf.noarch
MySQL-shared-compat-5.5.29-1.el6.i686
MySQL-embedded-5.5.29-1.el6.x86_64
MySQL-devel-5.5.29-1.el6.x86_64
MySQL-server-5.5.29-1.el6.x86_64
MySQL-shared-compat-5.5.29-1.el6.x86_64
perl-DateTime-Format-MySQL-0.04-1.el6.rf.noarch
qt3-MySQL-3.3.8b-30.el6.x86_64
perl-DBD-MySQL-4.013-3.el6.x86_64
perl-Time-Piece-MySQL-0.06-1.el6.rf.noarch
php-mysql-5.3.3-14.el6_3.x86_64
libmysqlclient15-5.0.95-1.w5.x86_64
MySQL-client-5.5.29-1.el6.x86_64
 
#7
I've remove those you asked and same result.

I've tried downloading the libmysqlclient for MySQL 5.5

https://www.archlinux.org/packages/extra/x86_64/libmysqlclient/

and got a different issue, but I think this may fix it as the .so files is .18 and the one I was running was .15

^Nevermind - Looks like it's working now.

Backup:
Code:
mkdir /root/mysqlbak
mkdir /root/mysqlbak/usr/
mkdir /root/mysqlbak/usr/bin/
mkdir /root/mysqlbak/usr/include
mkdir /root/mysqlbak/usr/lib
mkdir /root/mysqlbak/usr/share

cp -rf /usr/bin/mysql_config /root/mysqlbak/usr/bin/
cp -rf /usr/bin/include/mysql/ /root/mysqlbak/usr/include/
cp -rf /usr/bin/lib/libmysql* /root/mysqlbak/usr/lib/
Code:
mkdir /usr/src/libmysqlclient/
cd /usr/src/libmysqlclient/
wget http://mirror.us.leaseweb.net/archlinux/extra/os/x86_64/libmysqlclient-5.5.29-1-x86_64.pkg.tar.xz
tar -xf libmysqlclient-5.5.29-1-x86_64.pkg.tar.xz
Code:
cd /usr/src/libmysqlclient/usr/
cp -rf * /usr/
Note might want to move the mysql directory to mysql-old otherwise might have to keep trying y for 'yes' to overwrite files.
Changed:
Code:
'--with-mysql=shared,/usr/lib64/mysql/mysql_config'
Code:
'--with-pdo-mysql=shared,/usr/bin/mysql_config'
To:

Code:
'--with-mysql=shared,/usr/bin/mysql_config'
Code:
'--with-pdo-mysql=shared,/usr/lib64/mysql/mysql_config'
New Config:

Code:
'--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-bz2' '--with-curl=shared,/usr' '--with-freetype-dir=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/usr' '--with-mysql=shared,/usr/bin/mysql_config' '--with-openssl' '--with-openssl-dir=/usr' '--with-pic' '--with-png-dir=/usr' '--with-tidy=shared,/usr' '--with-xmlrpc=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--with-pdo-mysql=shared,/usr/bin/mysql_config'
LiteSpeed is now compiled.
 
#9
thanks fot the sharing. useful for others when encountering same issue.
That's why I replied, because I hate it when people "reply" and said "I fixed it" - Like "What did you do?" End of posts.

Compiles fine successfully, now just have a issue where MySQL isn't connecting at all.

All the pages are blank.

Nothing in the error.log file.

Compiling now and I reply if this fixes it.
 
#10
I did get "Blank Pages" and I just fixed it.

You don't necessarily need to the the libs like I did above;

Code:
cd /usr/src/
wget [url]http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm[/url]
rpm -ivh centalt-release-6-1.noarch.rpm
yum install mysql-libs
This should allow you to compile and don't have blank pages.

Config:

Code:
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-bz2' '--with-curl=shared,/usr' '--with-freetype-dir=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/usr' '--with-mysql' '--with-openssl' '--with-openssl-dir=/usr' '--with-pic' '--with-png-dir=/usr' '--with-tidy=shared,/usr' '--with-xmlrpc=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed' '--with-pdo-mysql'
Shouldn't need it, but right now the server works, but if the problem does arise this is what's added in my php.ini

Code:
extension_dir="/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.3.so"         
extension = "mysql.so"
extension = "mysqli.so"
extension = "tidy.so"   
extension = "xmlrpc.so"
extension = "xcache.so"
extension = "pdo_mysql.so"
extension = "curl.so"              
extension = "libfreetype.so"
Hope this helps for other people!

Regards,
Cory
 
Top