最近出现过一个问题,值得记录

类似于这样的报错的问题:

Warning: require_once(/www/app/somecomponent.php): failed to open stream: Cannot allocate memory in /www/app/loader.php on line 130

Fatal error: require_once(): Failed opening required '/www/app/somecomponent.php' (include_path='.:/usr/local/php/lib/php') in /www/app/loader.php on line 130

提示无法分配内存,无法打开文件

我的环境是在虚拟机建立了一个Centos6.5系统,并且在那里挂载我的Windows7桌面版的其中一个用户的共享目录,在那个目录进行开发

在无法分配内存时,我尝试过设置/etc/php.ini 的memory_limit (内存限制)设置,从128增加到256,还是报错,而且我的虚拟机空闲内存是够的,我还特别为它配置的是2G内存。

而一般无法打开文件,一般是权限问题,或者文件不存在,然后这些我通过root并且重新更改权限,并且通过ls判断文件的路径是否正确,都确定权限和文件位置都是非常正确的

那么为什么会出现问题呢?

后来发现,原来是这样:

It turns out this was a problem with my windows share. Perhaps because Windows 7 is a client OS, it is not tuned to serve large amounts of files frequently (which is happening in my case).

To fix, set the following keys in the registry

原来,这是Windows共享的问题,windows7旗舰版是为桌面用户提供的良好体验系统,在针对共享这个问题方面,并没有去调整共享文件的频繁大量读取

所以需要自己去注册表修改:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache 默认为0 修改为1

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\Size    默认为1 修改为3

籍此得出结论,作为一名开发者,配置的开发系统一定要是适合开发的系统,这样才好保证一些环境下的问题。

报错:require_once cannot allocate memory----php,以前自己弄的稍微有点特殊的开发环境的更多相关文章

  1. git clone报错: Out of memory, malloc failed (tried to allocate 524288000 bytes)

    IDEA 拉取项目报错:Out of memory, malloc failed (tried to allocate 524288000 bytes) 执行 git config --global ...

  2. 推送GitHub报错 fatal: Out of memory, malloc failed 解决办法

    现象: 推送GitHub时,出现如下报错 fatal: Out of memory, malloc failed (tried to allocate XXXXXX bytes)error: fail ...

  3. tomcat启动报错There is insufficient memory for the Java Runtime Environment to continue

    tomcat启动报错后显示以下错误 ## There is insufficient memory for the Java Runtime Environment to continue.# Nat ...

  4. nginx报错zero size shared memory zone one

    为了限速,在虚拟主机中加上了一个参数:limit_conn one 1:结果导致重启nginx报错: zero size shared memory zone "one"解决办法是 ...

  5. Android开发 处理内存申请失败的报错(Failed to allocate a 38189038 byte allocation with 16777216 free bytes and 20MB until OOM)

    问题原因 当你在操作图片或者其他大量文件数据时会出现:Failed to allocate a 38189038 byte allocation with 16777216 free bytes an ...

  6. Ant报错之out of memory

    用Ant打包一个比較大的项目的时候,遇到OutOfMemory的问题,求助于Google和百度,网上的解决方式非常多,可是个人认为不够具体全面.我的问题须要综合两种方法才解决.把方案记下来.以期帮助大 ...

  7. python 运行脚本报错 from keyword import iskeyword as _iskeyword ImportError: cannot import name iskeyword,说明python环境坏了,得重装,尚不知具体原因,

    C:\Python27\Scripts>python task_test.pyTraceback (most recent call last):  File "task_test.p ...

  8. git push的时候报错: Out of memory, malloc failed (tried to allocate 82037333 bytes)

    原因:上传的文件过大,这里我上传的文件有10G+所以报了上面的错误 解决方法:依次运行:git config --global pack.threads 1 git,git config --glob ...

  9. 安装Php时候报错信息:virtual memory exhausted: Cannot allocate memory (不能分配内存)

    原因是fileinfo这个函数在编译时非常消耗内存,而系统内存又不够了,所以才会出现此问题. 网上找了方法: 1,关闭其他占用大内存的进程. 2,在编译是添加参数 --disable-fileinfo

随机推荐

  1. Python python对象 deque

    # deque对象 ''' class collections.deque([ iterable [,maxlen ] ] ) 返回一个从左到右(使用append())初始化的新deque对象,其中包 ...

  2. 以个人身份加入.NET基金会

    .NET 走向开源,MIT许可协议. 微软为了推动.NET开源社区的发展,2014年联合社区成立了.NET基金会. 一年前 .NET 基金会完成第一次全面改选,2014年 .NET基金会的创始成员中有 ...

  3. Mac OS安装Go语言及配置VSCode开发环境:一个工具(gopls)解千愁

    前言 截止到目前为止,Go语言已经更新到1.14.1,网上的很多教程均已经过时,我在此汇总并整理一下相关的教程,提供一个适合当下的Mac OS教程. 教程中使用了Go在1.11之后推出的依赖包管理工具 ...

  4. 1053 Path of Equal Weight (30分)(并查集)

    Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weig ...

  5. 1049 Counting Ones (30分)

    The task is simple: given any positive integer N, you are supposed to count the total number of 1's ...

  6. Windows上安装Docker

    一.下载地址: https://hub.docker.com/editions/community/docker-ce-desktop-windows 二.安装直接下一步下一步就好了 具体可看: ht ...

  7. 下载安装配置 Scala-2.12.11

    文章更新于:2020-03-24 安装惯例,文件附上链接放在文首. 文件名:scala-2.12.11.tgz 文件大小:19.83 MB 下载链接:https://downloads.lightbe ...

  8. NS网络仿真,小白起步版,双节点之间的模拟仿真(基于TCP和FTP流)

    set ns [new Simulator] set tracefd [open one.tr w] #开启跟踪文件,记录分组传送的过程 $ns trace-all $tracefd set namt ...

  9. Linux服务器 上传/下载 文档/目录

    1.从服务器上下载文件 scp username@servername:/path/filename /var/www/local_dir(本地目录) 例如scp root@192.168.0.101 ...

  10. Linux 系统篇(一)

    退出当前程序    quit 填充代码:    tab键 中断当前操作:    ctrl + c 键盘输入结束    ctrl + d 关机        shutdown 重启        reb ...