Problem:
Environment: Ubuntu system, xampp1.8.3-5 Building Station Tools
Description: Run as Root. Apache's DocumentRoot = "/var/www". Thinkphp installation package is placed directly under the directory, browser access: http://127.0.0.1/htdocs/thinkphp/public/, prompted:
Fatal Error: uncaught exception ' think\exception\errorexception ' with message ' error_log (/var/www/htdocs/ thinkphp/public/. /runtime/log/16_10_28.log): failed to open stream: insufficient permissions ' in/var/www/htdocs/thinkphp/thinkphp/library/think/log/drive r/file.php:78 Stack trace: #0 [internal function]: think\error::apperror (2, ' error_log (/var/... '), '/var/www/htdocs ... ' ,/var/www/htdocs/thinkphp/thinkphp/library/think/log/driver/file.php, Array) #1: error_log (' [2016-10-28T22. . ', 3, '/var/www/htdocs ... ') #2/var/www/htdocs/thinkphp/thinkphp/library/think/log.php (149): think\log\driver\ File->save (Array) #3/var/www/htdocs/thinkphp/thinkphp/library/think/error.php (): think\log::save () #4 [ Internal function]: think\error::appshutdown () #5 {main} thrown in /var/www/htdocs/thinkphp/thinkphp/library/thin k/log/driver/file.php on line
Solve:
Two properties of files that involve Linux systems: the owner of the file and the user group of the file, and the execution permissions of the Program.
The program does not have permission to create a new directory using the MkDir function in the DocumentRoot directory and its subdirectories, and the file owner and attribution group for the Apache publishing directory are Root. View the top two file properties of the executable program File.
The entire system runs, all of which have Apache boot to view its service process.
1 PS grep " httpd "
View Code
The Apache startup process belongs to the daemon user, and the Apache publishing directory does not have open permissions to other users or to the same group of users corresponding to the execution or write Permissions.
Perform:
1 chown -r daemon:daemon/var/www/
View Code
In the process of solving the permissions problem, It is good practice to find that the Apache publishing directory is best positioned to the public directory of thinkphp, otherwise the access will be Problematic.
thinkphp on Ubuntu: the use of mkdir