thinkphp on Ubuntu: the use of mkdir

Source: Internet
Author: User
Tags stack trace

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.