After handling the LNMP environment, the access denied error is rendered
Set up a good LNMP environment, rendering access denied error, now removed the file permissions of the problem is also swept away is nginx problem, but can not parse the problem of PHP.
Found that many of the online Daniel are nginx log to troubleshoot, but turned nginx.conf found that my log information is not meticulous, so I hope to configure the Log_format
Configure the Nginx Log_format
① Open nginx.conf
② the original Log_format line, use the following local exchange
Log_format Main ' $remote _addr-$remote _user [$time _local] '
' fwf[$http _x_forwarded_for] tip[$http _true_client_ip] '
' $upstream _addr $upstream _response_time $request _time '
' $geoip _country_code '
' $http _host $request '
"$status" $body _bytes_sent "$http _referer"
"$http _accept_language" "$http _user_agent"
③ Custody Exit
Restart Nginx
Open Nginx log file, find Error.log,tail-f Error.log, found the following error
From the first line can be found to be a PHP error, search problems, found that PHP is limited to the operation of the directory, now can only operate in the/tmp/folder, so in the nginx of the Www-root folder can not operate, so attack the error of rebuffed access
Processing plan:
① Open php.ini File
② Find Open_basedir place.
③ the line, comment out the meaning is that PHP can operate in any folder, if you want to be able to run under the specified folder, the Open_basedir set to the appropriate directory
④ Custody and exit
Restart PHP-FPM Service PHP-FPM restart
Then visit the Web page and discover that the problem is addressed.
Thank you for reading, I hope to help you, thank you for your support for this site!