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.

Memory issues when PHP is running as suPHP

Discussion in 'General Discussion' started by sheringp, Oct 17, 2009.

  1. sheringp

    sheringp Registered

    Joined:
    Sep 27, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I am getting this error when PHP is running as suPHP. It is OK when PHP is configured to run as DSO.

    ========================================
    [Sat Oct 17 11:27:38 2009] [error] [client xxx.xxx.xxx.xxx] Failed loading /usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so: /usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so: failed to map segment from shared object: Cannot allocate memory
    ========================================

    Could anyone please help me to find what could be causing this.

    Any help in troubleshooting the problem is highly appreciated.

    Many Thanks,
    Sherin
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What is your PHP version?

    If possible, please provide the output from the following commands (via root SSH access):
    Code:
    # /usr/local/cpanel/bin/rebuild_phpconf --current
    # /usr/local/bin/php -v
    # /usr/local/bin/php -i | grep configure
    Zend Optimizer has known issues with certain newer versions of PHP, including PHP v5.2.10 and v5.2.11; for better compatibility with Zend Optimizer a safe PHP version to revert to (via EasyApache) is PHP v5.2.9.
     
  3. Arvand

    Arvand Well-Known Member
    PartnerNOC

    Joined:
    Jul 26, 2003
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    18
    Several of our servers started giving the 500 internal server errors on all php sites. In the logs, the above error showed. The results of the commands are:

    root@lamp [~]# /usr/local/cpanel/bin/rebuild_phpconf --current
    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: suphp
    PHP5 SAPI: suphp
    SUEXEC: enabled
    root@lamp [~]#
    root@lamp [~]# /usr/local/bin/php -v
    PHP 5.2.11 (cli) (built: Oct 28 2009 07:02:16)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with the ionCube PHP Loader v3.3.7, Copyright (c) 2002-2009, by ionCube Ltd., and
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
    root@lamp [~]# /usr/local/bin/php -i | grep configure
    Configure Command => './configure' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zend-multibyte' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=/usr' '--with-pic' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'


    So you are saying that switching to 5.2.9 may resolve the issue?
     
  4. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Please make sure that you have assigned 644 permission to your .php files and also make sure that there is no php functions assigned in your .htaccess file.
     
  5. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    Also check the size of suphp_log file located in /usr/local/apache/logs if it was 2GB then you should rotate it.
     
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I would re-install Zend Optimizer; thee is a newer version that should work better with PHP up to version 5.2.12, as seen below:
    Code:
    # /usr/local/bin/php -v
    PHP 5.2.12 (cli) (built: Jan 19 2010 17:10:33) 
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
        with the ionCube PHP Loader v3.3.7, Copyright (c) 2002-2009, by ionCube Ltd., and
        with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
        with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH
    Here are two commands that may be used to remove and then re-install Zend Optimizer in PHP:
    Code:
    # /scripts/phpextensionmgr uninstall Zendopt
    # /scripts/phpextensionmgr install Zendopt
     
Loading...

Share This Page