PHP运行错最有效解决办法Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on lin

简介: 原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312) Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744疑问:786432 是指786432bytes?即:768MB 98304 bytes=96MB 那0.75M是怎么算出来的。

原文 PHP运行错最有效解决办法Fatal error: Out of memory (allocated 6029312)

Fatal error: Out of memory (allocated 786432) (tried to allocate 98304 bytes) in H:\freehost\zhengbao2\web\includes\lib_common.php on line 744
疑问:786432 是指786432bytes?即:768MB 98304 bytes=96MB 那0.75M是怎么算出来的。
正确答案:786432bytes=768KB=0.75MB 98304bytes=96KB=0.09MB ?
最小是位 <其次字节(byte)<KB<MB<GB<TB
一个字节 =8位
1KB=1024B(字节)
1MB=1024KB
1GB=1024MB
1TB=1024GB

千,1KB=2的10次方=1024B,
兆,1MB=2的20次方=1024*1024B=1024KB,
吉,1GB=2的30次方=1024*1024*1024B=1024MB,
太,1TB=2的40次方=1024*1024*1024*1024B=1024GB,
拍,1PB=2的50次方=1024*1024*1024*1024*1024B=1024TB,
艾,1EB=2的60次方=1024*1024*1024*1024*1024*1024B=1024PB,
泽,1ZB=2的70次方=1024*1024*1024*1024*1024*1024*1024B=1024EB,
尧,1YB=2的80次方=1024*1024*1024*1024*1024*1024*1024*1024B=1024ZB. 

今天一个客户的网站出现这样的错误。程序是PHP的。经百度了一下。说明内存不足。中文件翻译的意思是:内存不足(分配786432)(尝试分配98304字节)
意思是尝试分配98MB的内存。但一般php设置为只允许给php程序分配 0.75M内存
解决办法:打开php.ini 修改memory_limit = 的这行
依照服务器配置进行调整
配置的内存使用大小修改后重启iis/apache
问题解决^^
PHP5.2.3-win32这个版本有个非常严重的bug,那就是最大内存设置成1024M,但是PHP实际返回的只有2M,经常返回下面的错误:
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1048576) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 786432) (tried to allocate 393216 bytes)
PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 393216 bytes)
这是官方的bug报告,该bug只出现于windows版本,linux版本没有这个bug。

目录
相关文章
|
8月前
|
缓存 前端开发 JavaScript
PHP - Laravel 创建项目到服务器(nginx、apache)运行(附带目录结构)
PHP - Laravel 创建项目到服务器(nginx、apache)运行(附带目录结构)
218 0
|
7月前
|
网络安全
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://xxxx.svc.cluster.local:8080/xxxx": Connection reset; nested exception is java.net.SocketException: Connection reset 什么原因导致得
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "xxxx.svc.cluster.local:8080/xxxx ": Connection reset; nested exception is java.net.SocketException: Connection reset 什么原因导致得
917 0
|
4月前
|
JSON 前端开发 PHP
dataType:'json'时post,总是调用error???附带php和json的一些坑
ajax是一个不错的东西 当dataType:'json'时提交,总是返回error 这是为什么? 经过折腾,终于发现因为要求的是json,返回的信息并不是json格式,因此总是出错
34 0
|
5月前
|
PHP
运行php服务,电脑抓不了包
运行php服务,电脑抓不了包
26 0
|
7月前
|
应用服务中间件 PHP nginx
PHP ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
PHP ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
54 1
|
8月前
|
应用服务中间件 PHP Apache
如何运行php文件
如何运行php文件
|
9月前
|
前端开发 JavaScript 数据可视化
javascript逐行显示数据及php实时输出前端内容后台保持继续运行的解决方案(setTimeout定时器、flush和ob_flush函数、安装进度展示)
javascript逐行显示数据及php实时输出前端内容后台保持继续运行的解决方案(setTimeout定时器、flush和ob_flush函数、安装进度展示)
134 0
|
9月前
|
前端开发 API PHP
php内存溢出:Allowed memory size of 1342bytes exhausted (tried to allocate 8192 bytes)本地配置和宝塔配置解决方案
php内存溢出:Allowed memory size of 1342bytes exhausted (tried to allocate 8192 bytes)本地配置和宝塔配置解决方案
85 0
|
9月前
|
弹性计算 安全 关系型数据库
阿里云ECS服务器宝塔Linux系统php和mysql运行环境配置步骤
阿里云ECS服务器宝塔Linux系统php和mysql运行环境配置步骤
290 0