开发者

Where to edit for increase in memory in PHP ini file?

Hi I 开发者_JS百科do have a PHP script which reads text file. when text file size is above the certain limit script gives error and stops. when I divide files into two it works. so where is that settings in PHP to increase read file memory?


The setting is memory_limit and you can change it in the php.ini file for all scripts, or (better) just change it in the code for the one script that is causing you problems:

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


There are three ways to change the memory_limit for your PHP script(s):

1) A quick solution would be to add the following line into your root directory .htaccess file:

php_value memory_limit 32M

2) In your PHP Config file (php.ini) -- Location depends on your Apache/server setup. Search the file for memory_limit and change to your desired value:

memory_limit= 32M

Then restart your apache server.


3) You can also specify the memory limit in your PHP script:

ini_set('memory_limit', '32M');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜