php修改内存大小_如何更改PHP允许的最大执行时间和内存大小

php修改内存大小

I see this message in the error log of httpd:

我在httpd错误日志中看到此消息:

PHP Fatal error:  Maximum execution time of 30 seconds exceeded in

and

PHP Fatal error:  Allowedmemory size of 268435456 bytes exhausted 

How to change them to a longer and larger value?

如何将它们更改为更长和更大的值?

To change the allowed maximum memory usage of PHP:

要更改PHP允许的最大内存使用量:

Set

memory_limit = 256M

in /etc/php.ini.

/etc/php.ini

To change the maximum allowed execution time of PHP:

要更改PHP的最大允许执行时间:

Set

max_execution_time = 300

in /etc/php.ini.

/etc/php.ini

You can also set these values in .htaccess if it is allowed by the server. For example, to set the memory_limit:

如果服务器允许,您还可以在.htaccess设置这些值。 例如,设置memory_limit

php_value memory_limit 256M

You can also set the values in the PHP script:

您还可以在PHP脚本中设置值:

ini_set('memory_limit', '256M');

Some programs has internal defined variables. For example, WordPress has an configuration variable that can be defined in wp-config.php:

一些程序具有内部定义的变量。 例如,WordPress具有可在wp-config.php中定义的配置变量:

define('WP_MEMORY_LIMIT', '256M');
Answered by anonymous.
匿名回答。

翻译自: https://www.systutorials.com/how-to-change-the-maximum-execution-time-and-memory-size-allowed-for-php/

php修改内存大小

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值