EA3 Concurrent PHP4/5 Compile - PHP Acceleration

verdon

Well-Known Member
Nov 1, 2003
945
16
168
Northern Ontario, Canada
cPanel Access Level
Root Administrator
Hi,

I'm setting up a dual php setup, so I can gradually move my clients from 4 to 5. As I have known php5 issues with a cms used by the majority of clients, I have php 4 set as default for now. Things seem to be working, but I guess today will tell for sure.

I used to use eaccelerator. I understand I won't be able to anymore with php5/suphp, I'll come back to that in a minute. I thought I would still be able to use it with php4, but I don't seem to be able to get it to load. It installed fine, just won't load either as zend_extension or extension.

So I guess I have a couple questions...

1) For php5/suphp, should I also be using fastcgi in place of a php accelerator?

2) For php4, shouldn't I still be able to use eaccelerator, or is my conf wrong?

3) Anything else look glaringly wrong in the conf below?

This is my php load conf
Code:
Default PHP Version 4
PHP 5 Handler suphp
PHP 4 Handler dso
Suexec on
These are my EA3 build options
Code:
Apache 1.3.39
* * Access
* * Actions
* * Alias
* * AuthnDefault
* * AuthzHost
* * Autoindex
* * CGId
* * DIR
* * Expires
* * Fileprotect
* * Headers
* * Log Config
* * Mime
* * Negotiation
* * Mod SuPHP
* * mod_proxy
* * Raise FD Setsize
* * Raise Hard Server Limit
* * Setenvif
* * Status
* * Unique Id
* * Userdir
* * Mod Security (requires unique id support in apache)

PHP 4.4.7
* * Bcmath
* * Calendar
* * Concurrent Mod_PHP patch
* * Curl
* * CurlSSL
* * DiscardPath
* * Exif
* * FTP
* * GD
* * Gettext
* * Iconv
* * Imap
* * Magic Quotes
* * Openssl
* * Sockets
* * Versioning
* * Zlib


PHP 5.2.3
* * Bcmath
* * Calendar
* * Concurrent Mod_PHP patch
* * Curl
* * CurlSSL
* * FTP
* * GD
* * Gettext
* * Iconv
* * Imap
* * Magic Quotes
* * Mysql
* * Mysql of the system
* * Openssl
* * Sockets
* * Zlib
 

verdon

Well-Known Member
Nov 1, 2003
945
16
168
Northern Ontario, Canada
cPanel Access Level
Root Administrator
It seemed to build/make and install ok. /usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so was created.

When I try to load it as a zend_extension, I get...
/usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so doesn't appear to be a valid Zend extension

as an extension...
PHP Warning: Unknown(): Invalid library (maybe not a PHP library) '/usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so' in Unknown on line 0

... in my apache error_log
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Try disabling all other Zend extensions,d o you still get the message about eAcc?

In /usr/php4/lib/php.ini, make all errors displayed:

Code:
display_startup_errors = On
display_errors = On
error_reporting = E_ALL
When you execute /usr/php4/php -v

is there any extra output that can help pinpoint the problem?

Does ldd /usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so show any missing libraries?
 

verdon

Well-Known Member
Nov 1, 2003
945
16
168
Northern Ontario, Canada
cPanel Access Level
Root Administrator
Try disabling all other Zend extensions,d o you still get the message about eAcc?
I don't think I have any other zend_extensions installed/enabled

In /usr/php4/lib/php.ini, make all errors displayed:
Doesn't seem to provide anything extra...

When you execute /usr/php4/php -v

is there any extra output that can help pinpoint the problem?
When I do /usr/local/php4/bin/php -v

I get:
/usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so doesn't appear to be a valid Zend extension
PHP 4.4.7 (cli) (built: Oct 21 2007 23:01:55)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

Does ldd /usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so show any missing libraries?
That returns:
libc.so.6 => /lib/i686/libc.so.6 (0xb7daa000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)


I appreciate your help. I'm almost wondering if I shouldn't just try from scratch again, and pay a little more attention to the make log. I really don't remember any errors though :)
 

jdlightsey

Perl Developer III
Staff member
Mar 6, 2007
126
2
243
Houston Texas
cPanel Access Level
Root Administrator
You only need the Concurrent Mod_PHP patch if you're running BOTH versions of PHP as DSO. If you run both as SuPHP, or one as DSO and one as something else, you don't need that patch.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
With PHP Concurrent, a strace of /usr/php4/bin/php -v shows this:

Code:
32164 open("/opt/mhash/lib/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/opt/libmcrypt/lib/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/usr/lib64/tls/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/usr/lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/opt/php_with_imap_client//lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/opt/openssl/lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/opt/libmcrypt//lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/opt/mhash//lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/lib64/tls/x86_64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/lib64/tls/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/lib64/x86_64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/usr/lib64/tls/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 open("/usr/lib64/eaccelerator.so", O_RDONLY) = -1 ENOENT (No such file or directory)
32164 write(2, "Failed loading eaccelerator.so:  eaccelerator.so: cannot open shared object file: No such file or directory\n", 108) = 108
It appears to be ignoring the extensions_dir directive in /usr/php4/lib/php.ini

The installation was done as follows:

Code:
export PHP_PREFIX="/usr/php4"
/usr/php4/bin/phpize 
./configure   --enable-eaccelerator=shared   --with-php-config=$PHP_PREFIX/bin/php-config
make && make install

EDIT:

Solved! Put the full path to the so in this directive:

Code:
zend_extension="/usr/php4/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so"
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Yes, I read the comments and decided to include my details for anyone else that may be wondering hwo to get it working with the concurrent patch.
 

verdon

Well-Known Member
Nov 1, 2003
945
16
168
Northern Ontario, Canada
cPanel Access Level
Root Administrator

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Thanks for that, interesting options :)
And right now, that is essentially the only documentation for suPHP

Of course, tuning some of those directives may improve performance somewhat, fewer checks to perform before execution and all.
 

johnchan

Active Member
Jun 29, 2003
40
0
156
1) For php5/suphp, should I also be using fastcgi in place of a php accelerator?
I would also be interested in this.

The basic idea of EAccelerator and APC for PHP is to cache scripts. However, when running suphp to call PHP, suphp creates/kills the PHP process EACH time it is run, so there is nothing to cache/save, even if the same PHP script is run again.

Or I could be wrong...?

I've done tons of searching here, but no one seems to know:-

Do ANY of the PHP accelerators (APC, EAccelerator, Zend Accelerator, etc.) work with suPHP? Is there ANY way to speed up suPHP?
 

johnchan

Active Member
Jun 29, 2003
40
0
156
I actually just noticed that the new version of buildapache includes the option to include EAccelerator! And it also allows you to select SuPHP at the same time.

Is this some workaround? Is there ANY performance benefit to Eaccelerator + Suphp?

I know Zend optimizer will speed up anything as it isn't caching, just reading the code and optimizing a bit, but perhaps Cpanel found a way to get Eaccelerator working at the same time as Suphp?
 

jdlightsey

Perl Developer III
Staff member
Mar 6, 2007
126
2
243
Houston Texas
cPanel Access Level
Root Administrator
Is this some workaround? Is there ANY performance benefit to Eaccelerator + Suphp?
Theres no performance benefit in using EAccelerator this way. The extension loads fine with mod_suphp, but you will not notice a performance improvement. The point of allowing mod_suphp and EAccelerator to be selected at the same time is that you can reconfigure how PHP is being served after EA3 has run.
 

Radio_Head

Well-Known Member
Verifed Vendor
Feb 15, 2002
2,048
1
343
If you install

Eaccelerator + Suphp using EA3

You will have this

PHP 5.2.5 (cli) (built: Dec 5 2007 04:43:34)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies

apparently eaccelerator is working , but it's NOT working .
Infact if you execute a phpinfo

Version 0.9.5.2
Caching Enabled false
Optimizer Enabled false

Also the eaccelerator admin interface will not work .

So , suphp and eaccelerator can't work togheter (at this time).

I think that EA3 should warns the admins that this option (Eaccelerator + Suphp) is not good.

of course if you installed Eaccelerator + Suphp (for error) there is no need to recompile apache.
Simply remove eaccelerator lines from your php.ini and restart apache.


Bye
 
Last edited: