About SuPHP and file permission settings

Source: Internet
Author: User
Tags cpanel
With regard to SuPHP and file permission settings, cPanel changed the PHPHandler mode to SuPHP, which resulted in an HTTP500Error when visiting the page. it was not known until you asked the reason, in SuPHP mode, no directory or file with the permission of 777 is allowed. In addition, in the SuPHP model... about SuPHP and file permission settings
CPanel changed the PHP Handler mode to SuPHP, so an HTTP 500 Error occurred when visiting the page. it was known only after asking the reason, in SuPHP mode, no directory or file with the permission of 777 is allowed. In SuPHP mode. modify php. ini parameter, so if the original. the htaccess file contains a setting starting with php _, which may also generate a 500 error when visiting the webpage.
How can we solve these problems?
First, check whether the directory or file permission is 777 in the file on the website. If yes, change the directory permission to 755 and the file permission to 644. It seems that you only need to execute chmod 644-R * in the webpage directory *. * This can be solved. However, things are not that simple, and such execution is incomplete. Finally, I found the data about how to set the host to SuPHP on the network, we can see more complete and better ways to modify all directories and permissions.
 
Modify directory permissions
Find/home/*/public_html-type d-exec chmod 755 {}\;
 
Modify file permissions
Find/home/*/public_html-type f-exec chmod 644 {}\;
In the above method, you can change the path in find to the path on your host. In fact, it is a very advanced use of find. If not all files on your host need to be set to 644, refer to the method on this webpage.
 
Find/home/*/public_html/-type d-print0 | xargs-0 chmod 0755 # For directories
Find/home/*/public_html/-type f-not-name "*. pl "-not-name "*. cgi "-not-name "*. sh "-print0 | xargs-0 chmod 0644 # For files
As for why should the host be changed from CGI to SuPHP? As mentioned in this article, we can see that the main reason is that SuPHP is highly secure, but its performance is inferior to CGI.
Related Article

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.