The file generated by executing commands in centos7-centosphpcli mode is root user permission, causing the web page to be unable to read this file

Source: Internet
Author: User
The file generated by running commands in centosphpcli mode is root user permission, which will cause the webpage to be unable to read the file and save the file. Have you ever encountered this problem, how does phpcli have the permission to execute commands?

The file generated by running commands in centos php cli mode is the root user permission, which will cause the webpage to be unable to read the file and save the file. Have you ever encountered this problem, php cli command execution permission issues

Reply content:

The file generated by running commands in centos php cli mode is the root user permission, which will cause the webpage to be unable to read the file and save the file. Have you ever encountered this problem, php cli command execution permission issues

You should not have used root to run a script for business processing. you can use the same user as nginx/php-fpm/apache httpd, or users in the same user group can run files.

For some reason (to be honest, the root operation is required because it cannot be found), you must use root.Sudo-u [user name]Temporarily switch the user to run the task, or use chown to modify the chgrp, chmod, and so on after the file is generated)

Finally, if you run the program through crontab, you can also specify the user's

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.