php 常用配置

1.禁用函数
disable_functions =  eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,pas
sthru,exec,system,chroot,scandir,chgrp,chown,escapeshellcmd,escapeshellarg,shell
_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlin
k,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close


2.错误日志:
display_errors =  Off
log_errors =  On
error_log = /usr/local/php/logs/php_errors.log
error_reporting =  E_ALL & ~E_NOTICE

mkdir /usr/local/php/logs
chmod 777  /usr/local/php/logs

此时就可以在  /usr/local/php/logs/php_errors.log 里面查看到错误

3.限制访问目录
open_basedir = /var/www:/tmp

4.设置每个虚拟主机都有自己的目录
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf 

php_admin_value open_basedir "/var/www/:/tmp/"




你可能感兴趣的:(PHP,常用配置修改)