Allowed memory size of 8388608 bytes exhausted

1、wampserver配置完以后,一般php.ini中默认的虚拟内存memory_limit=8M,但往往我们在配置一些框架或者开源产品时,在运行一些实例时,往往会报出错误,错误信息如下:

 Allowed memory size of 8388608 bytes exhausted (tried to allocate 24576 bytes)


如果需要解决这个问题,我们需要在PHP的配置文件php.ini去改变一些参数,memory_limit,把这个参数的值改的大一些就可以。但当你的PHP的配置文件不能直接修改的时候,我们需要在你的程序中去临时改变你的虚拟内存,比如说改成100M,int_set('memory_limit', '100M');

2、配置vhosts后,也会出现一些报错,譬如:

wampserver Forbidden You don't have permission to access / on this server.

报403,Forbidden,这往往需要在Apache中去修改参数来解决问题:Deny from all需要改为Allow from all,共需要改两处:

一处在:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    #Deny from all  修改为Allow
    Allow from all
    Satisfy all
</Directory>

另一处是:

<Directory "F:/wamp/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all
    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    #Deny from all 把Deny from all与Allow from 127.0.0.1修改为Allow from all
    Allow from all
    #Allow from 127.0.0.1
</Directory>


以上两个问题修改完成以后,均需要重启Apache,以便修改的配置文件立即生效。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值