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条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测