memory_limit是php.ini中的一个比较重要的参数了,它可以限制你php进行最大使用内存的情况,如果小了会导致运行时提示Fatal Error:Allowed memory size of xxxxxx bytes exhausted错误了,下面我们一起来看看解决办法.
编辑php.ini 在php.ini中,找到"memory_limit"这一项,如果没有,你可以在文件的尾部自己增加这个参数,以下是一些设置范例.
memory_limit = 128M;可以将128M改为任何你想设置的值
保存文件,重启php web 服务器,web服务器使用Apache, 则执行:httpd restart
你可能不被允许私修改php.ini,那么,你可以需要考虑用其他方法来增加memory_limit的值.
修改memory_limit大小方法2:.htAccess
说明:这种方法只有在php以Apache模块来执行时才生效,在你的网站的根目录下找到".htaccess"文件,如果没有,可以自己创建一个,然后把以下配置放入其中.
php_value memory_limit 128M;可以将128M改为任何你想设置的值.
修改memory_limit大小方法3:运行时修改php的内存设置
在你的php代码中增加以下命令行即可.
ini_set("memory_limit","128M");
教程网址:
欢迎收藏∩_∩但请保留本文链接。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
