在htaccess中设置内存限制 [英] Set Memory Limit in htaccess

查看:65
本文介绍了在htaccess中设置内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做文字印刷。我需要增加内存,因此将以下行添加到我的htaccess文件中

I am working on word press. I need to increase the memory so added the following line to my htaccess file

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

php_value memory_limit 64M

我的示例php页面


,但会引发500个内部服务器错误。

my sample php page

but it throws the 500 internal server error. what is the problem here..

推荐答案

在您的 .htaccess 中,您可以添加:

In your .htaccess you can add:

PHP 5.x

<IfModule mod_php5.c>
    php_value memory_limit 64M
</IfModule>

PHP 7.x

<IfModule mod_php7.c>
    php_value memory_limit 64M
</IfModule>

如果页面再次中断,则说明您在Apache中使用PHP作为mod_php,但是由于某些原因而导致错误否则。

If page breaks again, then you are using PHP as mod_php in apache, but error is due to something else.

如果页面没有中断,则说明您使用PHP作为CGI模块,因此不能使用php值-在我提供的链接中可能是解决方案,但我''不确定您是否能够应用它。

If page does not break, then you are using PHP as CGI module and therefore cannot use php values - in the link I've provided might be solution but I'm not sure you will be able to apply it.

有关 http://support.tigertech.net/php-value

这篇关于在htaccess中设置内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆