Home  >  Article  >  Backend Development  >  what is php configuration file

what is php configuration file

(*-*)浩
(*-*)浩Original
2019-09-20 15:05:008544browse

What are the PHP configuration files?

what is php configuration file

PHP used with nginx has three configuration files: php.ini, php-fpm.conf, www. conf.

php.ini is the core configuration of PHP runtime. The PHP process in CLI mode and php-fpm mode all read the configuration items in php.ini.

php-fpm.conf is the configuration file of the php process managed by php-fpm. (Recommended learning: PHP programming from entry to proficiency)

The php process running in this mode, in addition to reading the configuration items in php.ini, also reads php -Configuration items in fpm.conf.

www.conf is a supplement to php-fpm.conf.

Important configuration in php.ini

######避免PHP信息暴露在http头中
expose_php = Off

######避免暴露php错误信息
display_errors = Off

######在关闭display_errors后开启PHP错误日志(路径在php-fpm.conf中配置)
log_errors = On

######设置PHP的扩展库路径
extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-non-zts-20141001/"

######设置PHP的opcache和mysql动态库
zend_extension=opcache.so
extension=mysqli.so
extension=pdo_mysql.so

######设置PHP的时区
date.timezone = PRC

######开启opcache
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1

######设置PHP脚本允许访问的目录(需要根据实际情况配置)
;open_basedir = /usr/share/nginx/html;

Important configuration in php-fpm.conf

;php运行日志
error_log=log/php-fpm.log

;FPM使用的事件机制
events.mechanism = epoll

;php-fpm.conf的补充文件www.conf的路径include=/usr/cg/lnmp/php-7.0.13/etc/php-fpm.d/*.conf

The above is the detailed content of what is php configuration file. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn