Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i have a program that runs once when my website loads (randomphoto block in a nuked gallery 1.43a). it requires more than the standard 8 mb memory set in /etc/php.ini. (e.g. memory_limit 32M). Since php.ini governs any php script, i am concerned that just increasing the limit for the entire server could cause stability problems. I need to know if there are alternatives for setting the memory limit, especially in a .htaccess file.
Iwould like to allow this increased memery consumption for this one program or one website.
I have seen suggestions that the memory limit can be set as part of the virtual host configuration:
php_admin_value memory_limit 20M
I have heard that php parameters can be set in .htaccess files but have not seen an example of this for memory.
logged error message
[client 192.168.0.44] PHP Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/modules/gallery/classes/Album.php on line 783
According to the PHP manual, memory_limit is only available if PHP has been compiled with the --enable-memory-limit flag. It can be set everywhere, which includes httpd.conf and .htaccess. For those two files, use something like this: