我在aws emr上运行一个失败的错误' PHP致命错误:允许的内存大小为134217728字节耗尽'
我尝试添加引导动作脚本
#!/usr/bin/php
<?php
ini_set('memory_limit', '2048M');
?>
使用主人:m1.large 核心:m3.xlarge
但它没有增加内存限制,我仍然收到同样的错误。
如何在AWS EMR中增加php内存限制。
由于
答案 0 :(得分:1)
对AWS php ini
的简单谷歌搜索提出了这个问题:
https://serverfault.com/questions/543077/how-to-add-directives-to-php-ini-on-aws-elastic-beanstalk
我发现最干净的方法是在项目档案中使用.ebextensions配置文件:
示例.ebextensions / project.config文件:
files: "/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize = 64M
post_max_size = 64M
部署应用程序版本时,这将在php.d目录中编写自定义配置文件 覆盖任何php.ini设置。
答案 1 :(得分:0)
please try this one in php.ini not in apache
php_value memory_limit 2048M
and also try this way in .htaccess
Notice: This method will only work if PHP is running as an Apache module.
Find the “.htaccess” in your root directory of the specified domain, if there isn’t, create one. Put the following line in it.
php_value memory_limit 128M; /* Change the 128M to your needs */