Whilst Running the PHP Spike Security Audit Tool to audit a php source files directory containing large number of PHP files,like let’s say 700+ php files produces the following error:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /usr/local/spike_phpSecAudit_0.27/util/TokenUtils.php on line 85
It’s obvious that php spike is written in a way that all audited php files are stored in memory before being processed.
Therefore the larger amount of php source code targeted to be audited by the Spike Security PHP Audit tool the highter the amount of necessery memory by the spike security audit php script.
For that reason it’s necessery to increase the allowed amount of memory that the php CLI (Command Line Interface) can consume.
The default value for memory limit on the PHP5 precompiled binary on Debian Lenny is 16 MB. This value is really low and needs to be increased in order to be able to run the spike PHP Sec Audit on directories with many php scripts.
There are basicly two ways to achieve that:
1. Edit /etc/php5/apache2/php.ini on Debian Linux
And Increase the value:
memory_limit = 200M
Increasing the memory_limit from the php.ini configuration is not really wise since that will lessen your security. So use this only if you know what you’re doing.
2. Or the other possibility to get around the error message is increase the memory_limit value via the PHP Spike Source Security Audit script
That is by the way, the better choise IMHO. If you go that way edit your run.php script bunled with the spike_phpSecAudit archive and there make sure you insert on the second line:
ini_set('memory_limit', '200M');
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Hey long time now see, thanks for dropping back again! 🙂
More helpful Articles
- Windows add / delete services command sc.exe create/delete – Create or Delete services
- How to solve “eAccelerator requires Zend Engine API version 220060519 , the Zend Engine API version 220090626 which is installed, is newer. Contact eAccelerator at http://eaccelerator.net for a later version of eAccelerator.” on FreeBSD
- Fix staled NFS on server with dmesg error log nfs: server nfs-server not responding, still trying
- How to calculate connections from IP address with shell script and log to Zabbix graphic
- yum add proxy on CentOS, RHEL, Fedora Linux howto
- How to easy add Joomla 1.5 donate Paypal capabilities with Joomla PAYPAL DONATION MODULE
- Auto restart Apache on High server load (bash shell script) – Fixing Apache server temporal overload issues
- Merging pictures on Linux command shell with ImageMagick merge
- Lastpass – store and manage website passwords plugin for Firefox
- Disabling sound kernel modules on Debian and Ubuntu GNU / Linux servers
- Linux Local User Accounts Password Security policies Hardening – Set Password expiry, password quality, limit repatead access attempts, add directionary check, increase logged history command size
- How to fix Windows Vista / Windows 7 can not open drive C with explorer error: “This file does not have a program associated with it for performing this action. Create an association in the Set Associations control panel.”
- How to add manually adsense code to your wordpress blog in blog index and single page posts
- Disable Windows hibernate on a work notebook or Desktop Gamers PC – Save a lot of Space on Windows C Drive, delete hidefil.sys howto
Download PDF Tags: Using PHP Spike Security Audit Tool on large source trees / Fixing issues with PHP Spike Security Audit (Fatal Error: Allowed memory size exhausted)
This entry was posted on Sunday, April 25th, 2010 at 7:52 pm and is filed under System Administration. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.