2.8php.ini configuration file #/usr/local/php/bin/php-I | head // Check that the php. ini path is/usr/local/php/etc/php. ini
1. configure disable_function
# Vim/usr/local/php/etc/php. ini
Disable_functions = eval, assert, popen, passthru, primary, primary, passthru, exec, system, chroot, scandir, chgrp, chown, primary, primary, shell_exec, proc_get_status, ini_alter, primary, dl, pfsockopen, openlog, syslog, readlink, symlink, leak, popepassthru, stream_socket_server, popen, proc_open, proc_close
// Disable these functions
2. configure error_log
# Vim/usr/local/php/etc/php. ini
Display_errors = off // if it is on, an error is displayed in the browser access.
Log_errors = on
Error_log =/usr/local/php/logs/php_errors.log
# Mkdir/usr/local/php/logs // create a directory for generating error logs
# Chmod 777! $ // Change the permission to 777
Change error_reporting to error_reporting = E_ALL | E_STRICT
#/Usr/local/apache2/bin/apachectl graceful // reload
3. configure open_basedir
# Vim/usr/local/php/etc/php. ini
Open_basedir =/data/www/:/tmp // restrict user access to/data/www and/tmp directories only
# Vim httpd. conf // can be modified in Apache
Php_admin_value open_basedir "/data/www/:/tmp/" restrict user access