Memory issues when PHP is running as suPHP

sheringp

Registered
Sep 27, 2006
1
0
151
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
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
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.
 

Arvand

Well-Known Member
Jul 26, 2003
128
1
168
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:

[email protected] [~]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: suphp
PHP5 SAPI: suphp
SUEXEC: enabled
[email protected] [~]#
[email protected] [~]# /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
[email protected] [~]# /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?
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
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.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
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:

Code:
[email protected] [~]# /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
So you are saying that switching to 5.2.9 may resolve the issue?
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