1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

Discussion in 'Plesk 11.x for Linux' started by southsidetech, Sep 26, 2012.

  1. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    Help;

    Plesk 11.0.9
    PHP 5.3.3
    CENTOS 6.4

    I am getting the following error when trying to export data results to .xlsx file but if I export to .csv it is fine.

    It is not a big data export only 3mb 8000 records from the db.

    mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in

    I have tried all the increasing memory_limit etc but nothing works.

    Stewart
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,543
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    For user's or for admin's php?
     
  3. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    IgorG;

    I running a report using a php export script page at the following URL, which works fine for dozens of other reports in XLSX format and this particular report in question if you do not select all records but just about 4000 max if you select all 8000 it errors:

    The query seems quick and fine on all reports.

    https://www.domain.com/v1/reports2/export.php

    I have tried adding the memory_limit 256M and also tried memory_limit 512M in the following files.

    1. /etc/php.ini
    2. .htaccess in the root of the v1 folder
    3. In the export.php file itself
    4. In Plesk within the domain PHP settings changing the default to custom value

    I also looked at the /etc/httpd/conf.d/fcgid.conf file vales and changed the IOTimeout and reconfigured the domain.com in question.

    None of the worked.

    To expand I am running a report which is built using PHPRunner product that sits in the reports2 subdirectory of the domain.com root. http://www.xlinesoft.com/phprunner/index.htm

    The thing is the report runs fine if I export to CSV all values but if XLSX it crashes out.

    It works fine on the companies test server that writes the PHPRunner software they say it is a memory limit issue.

    Hope this helps.

    Stewart
     
  4. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    IgorG

    Forgot to say when the memory_limit is 128M

    You get the following error in the browser:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 93 bytes) in /var/www/vhosts/domain.com/httpdocs/v1/reports2/plugins/PHPExcel/Worksheet.php on line 961

    The file changes each time so it is not the file or line 961.

    If you increase the memory limit to 512M you get a 500 internal server error page instead.

    This is what appears in the plesk domain level error_log

    [Wed Sep 26 10:39:42 2012] [warn] [client IP] mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/vhosts/domain.com/httpdocs/v1/reports2/plugins/PHPExcel/Style/Color.php on line 399, referer: https://www.domain.com/v1/reports2/export.php?
     
  5. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    IgorG;

    Can you help on this issue please?

    Stewart
     
  6. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    Igor can you help with this issue?
     
  7. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,543
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    I can suppose only that increasing memory_limit in global php.ini should help. Most probably there is some special additional setting in configs of this plugin.
     
  8. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    Igor;

    OK I am sure I tried that but will I just restart Apache after the global php.ini change or do I need to re-configure vhosts etc can you supply the steps.
     
  9. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    IgorG

    I think it is something to do with a script timeout in the fcgid.conf

    Can you explain where I can edit this for a domain in Plesk 11

    I have increased the memory and now get a 500 internal server error premature end of script headers

    Please help
     
  10. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    Please click one of the Quick Reply icons in the posts above to activate Quick Reply.
     
  11. southsidetech

    southsidetech New Pleskian

    12
    85%
    Joined:
    Oct 11, 2011
    Messages:
    9
    Likes Received:
    0
    IgorG

    OK we have made changes to the following files to get the report to run however the length of time to run is unacceptable so there must be an issue.

    We VI'd the following file:

    /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php

    We added the following FcgidIOTimeout 300 like this:

    <IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/domain.com/etc/php.ini
    FcgidMaxRequestLen 16777216
    FcgidIOTimeout 300
    </IfModule>

    Then we did a:

    /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain-name>

    Then we checked that the following file was updated:

    /var/www/vhost/<domain-name>/conf/last_httpd_ip_default.include

    Then we had to increase memory to 512M and the report ran but took 2.5minutes which is unacceptable on a server that is a Quad Core Xeon with 16GB RAM and 15k SAS drives.

    Can you make any suggestions to fix this and make the PHPExcel plugin report run in a reasonable time.
     
Loading...