douhu2131 2014-03-27 06:37
浏览 54
已采纳

如何在php文件中更改php.ini设置

i am installing vtiger6 in clients server. I don't have access to php.ini file. I have tried to change some php.ini setting throught my index.php file some settings works fine

ini_set('max_execution_time', 600);
ini_set('log_errors','off');

but i am not able to setup the following

ini_set('error_reporting','E_WARNING ^ E_NOTICE ^ E_DEPRECATED');
ini_set('allow_call_time_pass_reference','1');

and also i need to change the following too i don't know whether this is right or not

ini_set('max_file_uploads',300);
ini_set('memory_limit','240M');
ini_set('max_input_time ',600);

any help will be greatly appreciated.

  • 写回答

4条回答 默认 最新

  • dongxiaoke2018 2014-03-27 06:47
    关注

    The reason why error_reporting did not is, you set it's value to the following string. 'E_WARNING ^ E_NOTICE ^ E_DEPRECATED'. But it should not be a string. E_* values are PHP constants and should be used outside quotes like:

    ini_set('error_reporting',E_WARNING ^ E_NOTICE ^ E_DEPRECATED);
    

    Also you are using binary XOR (^) between these constants, which is unusual. Suggested value for production environments it is suggested to use E_ALL alone, for debugging. If you want all errors except E_DEPRECATED, you can use E_ALL & ~E_DEPRECATED

    Some PHP settings cannot be changed with ini_set. You can check PHP documentation for which variables allow setting on file level. For example, max_file_uploads is only changable from php.ini (documentation)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料