dongqiang4986 2012-04-30 15:24
浏览 63
已采纳

更改php.ini位置

Is it possible to change the location of php.ini to be used by Apache? When I did php -i | grep 'Configuration File', the result is:

Path => /usr/local/etc

Loaded Configuration File => /usr/local/etc/php.ini

But the result of phpinfo() is

Configuration File (php.ini) Path : /etc

I can copy over php.ini from /usr/local/etc/ to /etc/, but is it possible to change the php.ini folder?

I installed PHP using homebrew and I am using OS X Snow Leopard.

  • 写回答

2条回答 默认 最新

  • douzhouqin6223 2012-04-30 15:34
    关注

    PHP uses different .ini files when running via command line vs running as a web server module. When you grep the results of php -i your getting the command line ini. It's good practice to have separate ini's for the two environments.

    If you must change the directory PHP looks for the php.ini file, you can use the PHPIniDir in your web server conf file.

    If you wish to just add additional directories to be scanned, you can set the PHP_INI_SCAN_DIR environment variable.

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

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料