dprxj1995 2013-08-05 08:28
浏览 31

如何解决共享主机中的内存限制问题

i am getting memory limit error while loading some of the pages of my website.

My issue is, i don't have rights to modify memory_limit in php.ini so is there any other way to override this settings ?

I am getting following error.

Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 122880 bytes) in /xx/xx/xx/plugins/otbcCompanyPlugin/lib/model/om/BaseOtbcCompanyCompanyPeer.php on line 1567

i tried:

ini_set('memory_limit', '512M');
echo ini_get('memory_limit');exit; // prints 90M

And i tried following in .htaccess

<IfModule mod_php5.c>
php_value memory_limit 512m
</IfModule>

and

<IfModule mod_php.c>
php_value memory_limit 512m
</IfModule>

but didn't work.

you can check phpinfo().

so is there anything missed by me ?

  • 写回答

2条回答 默认 最新

  • dongmi1995 2013-08-13 23:28
    关注

    you can try to add your owen php.ini file in wich you specify :

    memory_limit = 512M
    

    to do so :

    1. create a php.ini file in your root folder
    2. add memory_limit = 512M
    3. create .htaccess file and add this line :

    SetEnv PHPRC /home/username/folder/php.ini

    this will load your custom instructions in your php.ini

    to make sure just run the

    <?php phpinfo() ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题