search
Homephp教程php手册Fatal Error: Allowed memory size of 123456789 bytes exhauste

今天在运行dedecms时出现有些页面会提示Fatal Error: Allowed memory size of 123456789 bytes exhausted了,下面我来给大家介绍如何解决些问题。

错误提示

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3214636 bytes) in E:VertrigoServwwwinstall.php on line 488

我们直接创建一个phpinfo.php文件,写入如下代码

然后就可以查看到你的内存

php内存分配不足:

1、修改php.ini(推荐)   

 代码如下 复制代码
memory_limit = 12M (改大点) 

 
2、在程序里面添加如下语句   

运行时修改php的内存设置

在你的php代码中增加以下命令行即可。

 代码如下 复制代码

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

?>

  

3、在根目录建立.htaccess文件,添加如下内容   

 代码如下 复制代码

php_value max_execution_time 1200
php_value memory_limit 200M
php_value post_max_size 200M
php_value upload_max_filesize 200M

memory_limit应该设为多少?

这个完全依赖于你的应用的要求。比如Wordpress,运行起核心代码需要32MB。Drupal 6则要求这个值最小为16MB,并推荐设置为32MB。如果你又安装不少的插件(plugins),尤其是那些要进行图像处理的模块,那么你可能需要 128MB或更高的内存。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools