A PHP script I am running (that is +x
) is running out of memory:
Williams-MacBook-Air:pmtsystem williamentriken$ phpcpd --exclude core/ .
phpcpd 2.0.1 by Sebastian Bergmann.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/bin/phpcpd/src/Detector/Strategy/Default.php on line 78
Is it possible to increase the memory for just running this one instance of phpcpd
?
Increasing the PHP memory limit The default memory limit is 256M and this is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.
By default, a PHP script can allocate up to 128 megabytes of memory.
Introduction. $_ENV is another superglobal associative array in PHP. It stores environment variables available to current script. $HTTP_ENV_VARS also contains the same information, but is not a superglobal, and now been deprecated. Environment variables are imported into global namespace.
Yes there is, try this:
php -d memory_limit=256M phpcpd --exclude core/ .
This will allocate 256Mb instead of your current 128Mb limit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With