PHP safe mode restriction in effect

Source: Internet
Author: User

Introduction: This is a detailed page of PHP safe mode restriction in effect. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 339599 'rolling = 'no'>

When safe_mode is set to on, PHP checks whether the owner of the current script matches the owner of the file to be operated through the file function or its directory. Example:-RW-r -- 1 Rasmus 33 Jul 1 19: 20 script. php
-RW-r -- 1 Root 1116 May 26/etc/passwd
Run script. php <? PHP
Readfile ('/etc/passwd ');
?>
If the security mode is activated, the following error occurs: Warning: Safe mode restriction in effect. The script whose uid is 500 is not
Allowed to access/etc/passwd owned by UID 0 in/docroot/script. php on line 2

Haohappy statement:
The reason is that you use the safe mode, and the UID of the user you upload the file is different from the UID of the owner, resulting in no access permission. For example, in safe mode, the UID of your FTP upload user is 123, and the UID of the uploaded owner is 456.

There are two solutions:
1. Disable security mode;
2. Change the owner of the file/directory in chown on the command line.
Of course, both methods require you to have server permissions.

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/339599.html pageno: 7.

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.