The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

EA3 Concurrent PHP4/5 Compile - PHP Acceleration

Discussion in 'General Discussion' started by verdon, Oct 22, 2007.

  1. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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
    
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Is eaccelerator not installing to /usr/php4?
     
  3. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    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?
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    I don't think I have any other zend_extensions installed/enabled

    Doesn't seem to provide anything extra...

    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

    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. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    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.
     
  7. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    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. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    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"
    
     
    #8 cPanelKenneth, Oct 22, 2007
    Last edited: Oct 22, 2007
  9. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    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. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    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.
     
  11. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    A little more reading, i.e. this thread - http://forums.cpanel.net/showthread.php?t=65213&highlight=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. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    There are something things you can change in /opt/suphp/etc/suphp.conf, but they are related to security checks - not performance.
     
  13. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks for that, interesting options :)
     
  14. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    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. johnchan

    johnchan Active Member

    Joined:
    Jun 29, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  16. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Houston Texas
    cPanel Access Level:
    Root Administrator
    Zend Optimizer should improve the performance of PHP running under mod_suphp since it's optimizing the compiled code rather than caching it.
     
  17. johnchan

    johnchan Active Member

    Joined:
    Jun 29, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  18. jdlightsey

    jdlightsey Perl Developer III
    Staff Member

    Joined:
    Mar 6, 2007
    Messages:
    126
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Houston Texas
    cPanel Access Level:
    Root Administrator
    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.
     
  19. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    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
     
    #19 Radio_Head, Dec 5, 2007
    Last edited: Dec 5, 2007
Loading...

Share This Page