惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
H
Help Net Security
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
B
Blog
I
InfoQ
SecWiki News
SecWiki News
T
Tailwind CSS Blog
Spread Privacy
Spread Privacy
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
M
MIT News - Artificial intelligence
S
Schneier on Security
T
Threat Research - Cisco Blogs
F
Fortinet All Blogs
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
The Cloudflare Blog
Recent Announcements
Recent Announcements
Security Latest
Security Latest
G
GRAHAM CLULEY
IT之家
IT之家
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
腾讯CDC
Google DeepMind News
Google DeepMind News
V
V2EX
S
Securelist
TaoSecurity Blog
TaoSecurity Blog
B
Blog RSS Feed
S
SegmentFault 最新的问题
博客园 - 叶小钗
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Project Zero
Project Zero
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
F
Full Disclosure

博客园 - SunWentao

Man or Honor 怒海潜将,壮志潜龙 美军的Navy Dive Carl Brashear unitycn.cn 关停了 windows 开发者神器 tc – total command和替代品 c#版本与vs的对应关系 十年前的博客,今天终于又回来了 配置total commander 显示所有或特定文件夹 (带点的文件夹) 如何删除cygwin c++ 11 practise -1- 在word中实现代码的语法高亮 最好用最方便的sqlite管理工具 日本小孩的教育 zz 2013年公司年会照片 跟乌克兰人学编程1 我不怕会1000种拳法的人,但我怕只会一种拳法,练1000遍的人. by 李小龙 乌克兰人的编程习惯 换个活法:临终前会后悔的25件事 内心强大的指标 史丹佛毕业25年 我最有钱的同学是...zz 榨汁机食谱大全
Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
SunWentao · 2013-01-06 · via 博客园 - SunWentao

Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法

在 php.ini 配置文档里面,默认的memory_limit 属性值为32M ,值设置得太小了而导致这个问题的出现。

解决这个问题,我们一般有三种方式:

1、修改PHP网站配置文件

在没有服务器配置权限时,编辑类似config.php这样的文件,给它加上一句:
define('MEMORY_LIMIT', '64M');
其中64M可以写得更大,比如128M。

注意文件编码。

2、修改php.ini配置文件

到你的网站根目录下,建立一个php.ini文件,写入下面这句:
memory_limit = 128MB
然后再到网站根目录下修改.htaccess这个文件,写入下面这句:
SetEnv PHPRC /home/vhost/public_html/site1/
(php.ini所在的路径)

3、在根目录建立.htaccess文件,添加如下内容:
php_value memory_limit 128M

注:修改php.ini配置文件将对服务器上所有PHP网站生效。