Solution to the problem that php.ini cannot be read: 1. Open the "/etc/init.d/php-fpm" file, and then add the specified configuration path to the "php_opts" command; 2. Just specify the path when starting.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php cannot read the specified php.ini configuration
Specify the path at startup
Solution 1: Modify the /etc/init.d/php-fpm file
# 在这行命令上添加 指定的配置路径 php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID" # 修改成 php_opts="--fpm-config $php_fpm_CONF -c /usr/local/php7/etc/php.ini --pid $php_fpm_PID"
Solution 2: Specify the path at startup
/usr/local/php/sbin/php-fpm -y /etc/php-fpm.conf -c /etc/php.ini
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if php.ini cannot be read. For more information, please follow other related articles on the PHP Chinese website!