Modify PHP config file, but sometimes we do not know the path of php.ini, this time we need to pass
Order to find out where.
/usr/local/php/bin/php-i |head
Look at that line Loaded Configuration File--/usr/local/php/etc/php.ini. If this is none, then the description is not loaded into the specific php.ini. After finding the php.ini, open it with vim and find that many lines are in the beginning, and this symbol is used as an annotation symbol in php.ini, that is to say, the lines that begin are not working. The common configuration in php.ini is as follows:
Search Disable_functions First
Disable_functions is configured as follows, PHP's disable function
Eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown, Escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog, Readlink,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close
The error log is then configured
Open configuration file
Modify
display_error=offlog_errors=onerror_log=/usr/local/php/logs/error.log
The first one is that the page displays an error message,
The second one is the error log.
The third one is the path to the error log
If the error log path does not exist,
mkdir/usr/local/php/logs/
Because the error log is written by Apache, authorization 777
777 /usr/local/php/logs/
Format of the configuration log, level of log
Search error_reporting
Find error_reporting= E_all & ~e_deprecated & ~e_strict
error_reporting = E_all & ~e_notice
Configuration complete, restart Apache
/usr/local/apache2/bin/apachectl Graceful
The error message will be
Ls/usr/local/php/logs/php_errors.log
Configuring security options, restricting file directories
Find Open_basedir =
Open_basedir =/data/www:/tmp
Can also be configured in Apache
Open the virtual host configuration file
Specify directory for non-access virtual hosts
Add a sentence to the virtual host configuration
" /data/www/:/tmp/ "
LAMP 2.8 php.ini Configuration file detailed