Change php.ini location

后端 未结 2 1162
既然无缘
既然无缘 2020-12-31 05:43

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:

相关标签:
2条回答
  • 2020-12-31 05:52

    To Change php.ini file path we have to declare PHPINIDir in the apache configuration file 'httpd.conf' syntax for that is :

    PHPINIDir "path_to_ini_file";
    
    0 讨论(0)
  • 2020-12-31 06:02

    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.

    0 讨论(0)
提交回复
热议问题