Jimmy99 Posted October 30, 2014 Share Posted October 30, 2014 I have osTicket installed on a Centos 5 Os with php5.3.3 I upgraded the osTicket from v1.9.1 to 1.9.4 I now get the following mail when I create a ticket by mailing in the support ticket This is the mail system at host mail.mydomain.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to <postmaster> If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system <support@mydomain.com>: Command died with status 255: "/usr/bin/php -q /var/www/html/support/api/pipe.php". Command output: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 76 bytes) in /var/www/html/support/include/class.osticket.php on line 261 PHP Warning: Unknown: Error occured while closing statement in Unknown on line 0 The osticket guys have pointed out to me that this is a php error, but I never made any changes to the php config When I increase the memory in php.ini to 512Mb or even 1024Mb the error persists. Anyone have any ideas of whether the memory is set/can be set somewhere else or overriding what is in php.ini ? Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted October 31, 2014 Share Posted October 31, 2014 268,435,456 bytes (250+ MBytes) is a SIGNIFICANT amount of memory for any script to use and if when you change the memory limit, the amount of allowed memory listed in the error also went up to 512,xxx,xxx and then 1,024,xxx,xxx bytes, this indicates a script that will consuming all available memory, no matter how much you make available to it. the script could either have a logic error that's consuming all memory (loading an array with the same data over and over in a loop for example) or of a script that needs to process a large amount of data, but isn't managing memory usage very well or at all. in any case, you, or better yet, the program's authors, will need to debug what the code and data are doing to find what's causing the large memory usage. edit: i downloaded the script, and the api/pipe.php page specifically sets the memory limit to 256M in the code. Quote Link to comment Share on other sites More sharing options...
Jimmy99 Posted November 5, 2014 Author Share Posted November 5, 2014 I increased the memory available to the script to 1Gb and it consumed all themeory and then some. how do you know that the problem is in pipe.php and not class.osticket.php?<support@mydomain.com>: Command died with status 255: "/usr/bin/php -q /var/www/html/support/api/pipe.php". Command output: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262097 bytes) in /var/www/html/support/include/class.osticket.php on line 263 PHP Warning: Unknown: Error occured while closing statement in Unknown on line 0 Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted November 5, 2014 Share Posted November 5, 2014 you won't directly know where the problem is at. the error is just being reported at the point in the code where the memory limit was exceeded. you would need to look at what the code was doing up to that point to pin down the problem. this error is most likely due to an initialization problem, i.e. some variable wasn't initialized before/each-time through a loop or similar. Quote Link to comment Share on other sites More sharing options...
Jimmy99 Posted November 5, 2014 Author Share Posted November 5, 2014 Can you point me in the right direction to understand how one would debug a php application? From my perspective I am a little familiar with MS Visual Studio, where you can step into the code and check variable values as you go along. Does php have something similar, or what is the preferred method to debug a php script? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.