Home >Backend Development >PHP Tutorial >centos7 - The file generated by executing the command in centos php cli mode has root user permissions, which will cause the web page to be unable to read this file.
The file generated by executing the command in centos php cli mode has root user permissions, which will cause the web page to be unable to read the file. It will be saved later. Have any experts in the group encountered this problem? How to execute the command in php cli Permission issues
The file generated by executing the command in centos php cli mode has root user permissions, which will cause the web page to be unable to read the file. It will be saved later. Have any experts in the group encountered this problem? How to execute the command in php cli Permission issues
You should not use root to run a business script. You can choose to use the same user as nginx / php-fpm / apache httpd, or a user in the same user group to run the file
For some reasons (to be honest, I can’t find many reasons why root is required to run), you must use root. You can use sudo -u [user name]
to temporarily switch users to run under root, or in the file After generation, use chown to modify the file ownership (chgrp, chmod, etc.)
Finally, if you run the program through crontab, you can also specify the user