Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 19
  1. #1
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default EA3 Concurrent PHP4/5 Compile - PHP Acceleration

    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

  2. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Is eaccelerator not installing to /usr/php4?

  3. #3
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    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

  4. #4
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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?

  5. #5
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by cpanelkenneth View Post
    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

  6. #6
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    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.

  7. #7
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by jdlightsey View Post
    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.
    Thanks JD. I'm not sure if that's the problem with EA, but I appreciate any info to optimize the build and get more familiar with the new system.

  8. #8
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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 by cpanelkenneth; 10-22-2007 at 10:42 AM. Reason: cleanup

  9. #9
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Solved! Put the full path to the so in this directive:
    Good to know... I had tried both

    For me though, it was what jdlightsey said. I rebuilt without Concurrent Mod_PHP and I seem to be OK now.

    Now if I can get fastcgi in the picture for php5/suphp I'll be laughing.

  10. #10
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

  11. #11
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by verdon View Post
    Now if I can get fastcgi in the picture for php5/suphp I'll be laughing.
    A little more reading, i.e. this thread - http://forums.cpanel.net/showthread....hlight=fastcgi - and I realize that fastcgi and suphp are not meant to go together. Is there anything I should be doing to optimize suphp, or is that pretty much it, out of the box?

  12. #12
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by verdon View Post
    A little more reading, i.e. this thread - http://forums.cpanel.net/showthread....hlight=fastcgi - and I realize that fastcgi and suphp are not meant to go together. Is there anything I should be doing to optimize suphp, or is that pretty much it, out of the box?
    There are something things you can change in /opt/suphp/etc/suphp.conf, but they are related to security checks - not performance.

  13. #13
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by cpanelkenneth View Post
    There are something things you can change in /opt/suphp/etc/suphp.conf, but they are related to security checks - not performance.
    Thanks for that, interesting options

  14. #14
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by verdon View Post
    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.

  15. #15
    Member
    Join Date
    Jun 2003
    Posts
    40

    Default

    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?

Similar Threads & Tags
Similar threads

  1. need help AddHandler application/x-httpd-php .php .php4 .php3 .html
    By rustikat in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 03-03-2009, 06:01 PM
  2. EA3 cannot compile PHP with curl on CentOS4.5 64bit
    By WebHostDog in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-01-2007, 12:08 AM
  3. Concurrent PHP
    By cpanelkenneth in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 11-06-2007, 03:58 PM
  4. EA3 Concurrent PHP4/5 Compile - no MySQL Support in PHP5
    By mtindor in forum cPanel and WHM Discussions
    Replies: 28
    Last Post: 10-24-2007, 01:00 PM
  5. Install PHP Zip module and zziplib - Compile PHP individually
    By Arvand in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-16-2003, 06:04 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube