簡體   English   中英

AWS EMR-如何增加php memory_limit

[英]AWS EMR - how to increase php memory_limit

我在aws emr上運行作業,失敗,並顯示錯誤“ PHP致命錯誤:允許的134217728字節耗盡的內存大小”

我嘗試添加引導操作腳本

#!/usr/bin/php
<?php
ini_set('memory_limit', '2048M');
?>

使用Master:m1.large Core:m3.xlarge

但是它沒有增加內存限制,並且我仍然收到相同的錯誤。

如何增加AWS EMR中的php內存限制。

謝謝

一個簡單的Google搜索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設置。

    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 */

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM