Custom PHP Compile issues.

VortMax

Well-Known Member
#1
Hello,
We are testing out the enterprise version of litespeed. I need to compile our own php from the 5.3.2 source. I am using Plesk 8.2 with php 5.3.2 installed.

This is the configure paramters I am using for the compile from a folder called downloads3

Code:
./configure '--with-litepseed' '--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' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-expat' '--with-pcre-regex' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba'
That completes with the following lines near the end:


Code:
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| You will be compiling the CGI version of PHP without any           |
| redirection checking.  By putting this cgi binary somewhere in     |
| your web space, users may be able to circumvent existing .htaccess |
| security by loading files directly through the parser.  See        |
| http://www.php.net/manual/security.php for more details.           |
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating main/php_config.h
config.status: main/php_config.h is unchanged
config.status: executing default commands
[root@local php-5.2.3]#


The I do a make. This takes a while with lots of warnings the last few lines read as such:

Code:
lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lcurl -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -lz -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lcom_err -lk5crypto -lresolv -ldl -lz -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt  -o sapi/cli/php

Build complete.
Then we do the make install and it completes with this:


Code:
[root@mxcp php-5.2.3]# make install
Installing PHP SAPI module:       cgi
Installing PHP CGI binary: /usr/bin/
Installing PHP CLI binary:        /usr/bin/
Installing PHP CLI man page:      /usr/share/man/man1/
Installing build environment:     /usr/lib64/build/
Installing header files:          /usr/include/php/
Installing helper programs:       /usr/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/share/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/share/pear/
[PEAR] Console_Getopt - already installed: 1.2.2
[PEAR] Archive_Tar    - already installed: 1.3.2
[PEAR] Structures_Graph- already installed: 1.0.2
[PEAR] PEAR           - already installed: 1.5.4
Wrote PEAR system config file at: /etc/pear.conf
You may want to add: /usr/share/pear to your php.ini include_path
Installing PDO headers:          /usr/include/php/ext/pdo/
[root@local php-5.2.3]#
I figure everything should be good to go, but there is no php file in the sapi/litespeed folder. However, when I do a php -v from the command line it says this:

Code:
[root@mxcp php-5.2.3]# php -v
Failed loading /usr/lib64/php/modules/php_ioncube_loader_lin_5.0.so:  /usr/lib64/php/modules/php_ioncube_loader_lin_5.0.so: undefined symbol: empty_string
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlreader' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlwriter' already loaded in Unknown on line 0
PHP 5.2.3 (cli) (built: Aug 24 2007 23:20:15)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
[root@local php-5.2.3]#

But, when I run a phpinfo it comes up with the old php version that came with litespeed.

I would really like to get this working because so far this appears to be a much better web server than apache and I would like to have it working correctly before my trial runs out in about 10 days or so.

Any help would be greatly appreciated.
 

mistwang

LiteSpeed Staff
#2
To fix those PHP Warnings you need to change your php.ini .
Get the latest ioncube loader package, load php_ioncube_loader_lin_5.2.so in php.ini.
Remove the configuration to load json, PDO, ... modules in php.ini., those modules has been compiled into PHP binary already.
 

VortMax

Well-Known Member
#3
After changing the first complier directive to the proper spelling everything got installed where it should be.

So when we do a "php -v" we now get:

Code:
[root@local lsws]# fcgi-bin/lsphp.5.2.3 -v
PHP 5.2.3 (litespeed) (built: Aug 25 2007 00:17:51)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
    with eAccelerator v0.9.5.1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
[root@local lsws]#
However,
after restarting the litespeed webserver our IPB forum no longer works. We just get a blank page. The litespeed administration control panel still works though.

I have checked all of the error logs and there is nothing obvious that sticks out.

When I run a phpinfo script it comes out OK with the custom php running.

Do you have any other ideas of where I could look for problems?
 

ffeingol

Well-Known Member
#4
Did you happen to change PHP versions? If you did you may need to recompile eAccelerator to go with the new version. Most of the time when we get blank PHP pages it means that one of the extensions (Zend, eAccelerator, Ioncube) is not in sync with the PHP version. You can quickly verify but just commenting out the eAccelerator/Ioncube from your php.ini and then restarting to see if that resolves the issue.

Frank
 

VortMax

Well-Known Member
#5
Did you happen to change PHP versions? If you did you may need to recompile eAccelerator to go with the new version. Most of the time when we get blank PHP pages it means that one of the extensions (Zend, eAccelerator, Ioncube) is not in sync with the PHP version. You can quickly verify but just commenting out the eAccelerator/Ioncube from your php.ini and then restarting to see if that resolves the issue.

Frank
Frank I will try disabling them both. I upgraded our server to Plesk 8.2 and then php 5.2.3 on the apache side. I did upgrade eaccelerator and ioncube to the latest and greatest as well.
 

VortMax

Well-Known Member
#6
Well that didn't work. I confirmed that lsphp was running without those extensions and it still came up with a blank page. :( This is very frustrating. :)

Also found out that when using the version that ships with the package that our forum's upload images no longer works either.
 

felosi

Well-Known Member
#9
well if phpinfo is showing the new custom php then its most likely some loaded extension you need for the new php version.

Are you getting a blank page on very site? Or just ones that need certain modules?
 

VortMax

Well-Known Member
#10
well if phpinfo is showing the new custom php then its most likely some loaded extension you need for the new php version.

Are you getting a blank page on very site? Or just ones that need certain modules?
We got it working thanks to some help from the staff here. :)

I am not sure what it was but I recompiled php (again) and it started to work. The sites that were not working were only php sites which happened to be drupal, mediawiki and our IPB forum software.
 
Top