Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    3

    Default ini_set or htaccess memory_limit kills php processing

    Any ideas or help here would be much appreciated!

    I updated PHP/Apache last night and any site that has either:
    ini_set(memory_limit) or an
    htaccess php_value memory_limit

    (Any other ini_set or php_value settings are still fine)

    command does not process any php files and returns page cannot be displayed 0 bytes from the browser. I thought it might have been something with suHosin at first but haven't had any luck with it.

    Is there a default setting that I might be missing or security option somewhere?


    PHP config --
    './configure' '--enable-bcmath' '--enable-calendar' '--enable-discard-path' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--prefix=/usr/local' '--with-apxs=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mm=/opt/mm/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-ttf' '--with-xpm-dir=/usr/X11R6' '--with-zlib' '--with-zlib-dir=/usr'

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2004
    Posts
    313
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: ini_set or htaccess memory_limit kills php processing

    Could be Suhosin:

    Hardened-PHP Project - PHP Security - Configuration

    Check your php.ini to see what the memory_limit Suhosin value is set to (0 means disabled, allowing users to set their own).
    NDCHost (ProVPS): Xen VPS / Dedicated / Co-Location
    Contact us for your cPanel Licensing needs! We price match, provide better support, and take care of our customers!

  3. #3
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Re: ini_set or htaccess memory_limit kills php processing

    Quote Originally Posted by mrlugal View Post
    Any ideas or help here would be much appreciated!

    I updated PHP/Apache last night and any site that has either:
    ini_set(memory_limit) or an
    htaccess php_value memory_limit

    (Any other ini_set or php_value settings are still fine)

    command does not process any php files and returns page cannot be displayed 0 bytes from the browser. I thought it might have been something with suHosin at first but haven't had any luck with it.

    Is there a default setting that I might be missing or security option somewhere?


    PHP config --
    './configure' '--enable-bcmath' '--enable-calendar' '--enable-discard-path' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--prefix=/usr/local' '--with-apxs=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mm=/opt/mm/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-ttf' '--with-xpm-dir=/usr/X11R6' '--with-zlib' '--with-zlib-dir=/usr'
    What was the prior PHP version? What is the new PHP version installed?

    I would save a backup of and then reset the main PHP configuration file(s), named php.ini, using the following commands (entered in the order listed):
    Code:
    # mv -v /usr/local/lib/php.ini /usr/local/lib/php.ini.backup
    # mv -v /usr/local/php4/lib/php.ini /usr/local/php4/lib/php.ini.backup
    # /scripts/phpini
    Here is an example of what the output may look like (assuming both PHP5 and PHP4 are installed):
    Code:
    # mv -v /usr/local/lib/php.ini /usr/local/lib/php.ini.backup
    `/usr/local/lib/php.ini' -> `/usr/local/lib/php.ini.backup'
    # mv -v /usr/local/php4/lib/php.ini /usr/local/php4/lib/php.ini.backup
    `/usr/local/php4/lib/php.ini' -> `/usr/local/php4/lib/php.ini.backup'
    # /scripts/phpini
    Updating php.ini for /usr/local ...Done
    Updating php.ini for /usr/local/php4 ...Done
    Updated php.ini default values to version 3.3
    Restarting Apache
    info [safeapacherestart] Restart elapsed seconds: 1

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    3

    Default Re: ini_set or htaccess memory_limit kills php processing

    Thanks for the feedback!

    Yep I tried suhosin setting both to zero or a large number to see if it was killing the scripts.

    The PHP version was the same (5.2.9), don't have php4 setup, I just recompiled adding PDO extensions using easy apache.

    I tried the /scripts/phpini command but it didn't return any output.

  5. #5
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,555
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Re: ini_set or htaccess memory_limit kills php processing

    Quote Originally Posted by mrlugal View Post
    Thanks for the feedback!

    Yep I tried suhosin setting both to zero or a large number to see if it was killing the scripts.

    The PHP version was the same (5.2.9), don't have php4 setup, I just recompiled adding PDO extensions using easy apache.

    I tried the /scripts/phpini command but it didn't return any output.
    Did you rename, i.e., move, the existing PHP configuration "php.ini" file so that a freshly reset php.ini could be installed? A new copy of the main php.ini will only be written if it does not already exist.

    I recommend upgrading PHP to a newer version (e.g., PHP 5.2.15); it is entirely possible that using an old version may exacerbate any issues, making it more difficult to diagnose, investigate and resolve.

Similar Threads & Tags
Similar threads

  1. php.ini memory_limit keeps resetting itself.
    By jols in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 05-18-2010, 01:02 AM
  2. Is there a way to make php ignore ini_set ?
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-23-2008, 07:37 AM
  3. malformed htaccess kills apache
    By MMarko in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-14-2007, 11:57 AM
  4. .htaccess not processing php_value
    By certify in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-12-2005, 05:48 PM
  5. Memory_limit in .htaccess
    By gopal in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-24-2004, 04:56 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube