LANMPS 配置文件说明及案例
LANMPS 配置文件说明及案例
PHP 以php7.1 为例
PHP 配置文件:/www/lanmps/php/php.ini
PHP-FPM 配置文件:/www/lanmps/php/etc/php-fpm.conf
php.ini 配置
php.ini
中默认禁用如下系统函数,如需使用,自行删除使用的函数,并重启PHP
disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
其他更改配置如下:
post_max_size = 50M ;默认8M 改为50M
upload_max_filesize = 50M ;默认2M 改为50M
date.timezone = PRC ;启用为PRC时区
short_open_tag = On ;默认关闭 改为启用
cgi.fix_pathinfo=1 ;开启 有的版本禁用,如需开启 请在 `/www/lanmps/nginx/conf/fastcgi.conf`最后一行中 加入 `try_files $fastcgi_script_name =404;`
max_execution_time = 300 ;默认30 改为300
mysql.default_socket=/www/lanmps/mysql/data/mysql.sock ;数据库
pdo_mysql.default_socket=/www/lanmps/mysql/data/mysql.sock ;数据库
expose_php = Off ;默认启用 改为关闭
php-fpm.conf 配置
error_log = /www/wwwLogs/php-fpm.log ;错误日志文件位置
log_level = notice ;记录日志级别
/www/lanmps/php7.1.x/etc/php-fpm.d/www.conf
pm.max_children = 10 ;
pm.max_spare_servers = 6
request_terminate_timeout = 100
127.0.0.1:9950 ;端口默认9000 改为9950
扩展
php opcache 扩展
;zend_extension=opcache.so ;改为关闭,如需启用请去除zend_extension前;号
opcache 其他配置说明略