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

    Default PHP flush() Function Not Working

    I'm running WHM X v3.1.0 and cPanel 11.18.5 on REDHAT Enterprise 4 x86_64.

    I just finished moving some scripts over from my old server and noticed that the PHP flush() function isn't working on this server. Are there any known issues with my WHM/default configuration that prevent flush() from returning input immediately? I've tried changing lots of settings in php.ini and several combinations using flush() and ob_*(), but no success.

    My test script should print ten lines: one line per second. Instead, it prints all ten lines simultaneously--ten seconds from when the script is called.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    Default

    Figured this out. It was being prevented by mod_security.

  3. #3
    Member
    Join Date
    Apr 2004
    Location
    Vancouver BC Canada
    Posts
    30

    Default

    where did you see mod_security? in your PHP.INI file, I am having the same issue with mine

  4. #4
    Member
    Join Date
    Apr 2004
    Location
    Vancouver BC Canada
    Posts
    30

    Lightbulb

    If flush is not working probably mod_gzip is enabled.
    To disable it just add following lines to .htaccess
    PHP Code:
    <IfModule mod_gzip.c>
    mod_gzip_on no
    </IfModule

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    Default

    mod_gzip was not running on my server, so that wasn't the problem. you can completely disable mod_security in httpd.conf or you can just disable the rule that's causing the problem (SecResponseBodyAccess) for specific files.

Similar Threads & Tags
Similar threads

  1. PHP function not working well
    By fatepower in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-13-2009, 12:39 PM
  2. php mail() function not working
    By nowashburn in forum E-mail Discussions
    Replies: 2
    Last Post: 12-11-2008, 09:00 PM
  3. PHP Mail Function Not Working
    By jlimited in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 07-08-2006, 08:12 PM
  4. PHP function mail() is not working
    By Secret Agent in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-21-2006, 12:12 AM
  5. php mail function is not working
    By shann in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-23-2002, 04:33 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube