Server disabled chmod (), how to resolve

Source: Internet
Author: User
The chmod () function is disabled by the server
Upload file not even Read permission
Assuming that the server configuration is not changed, in the program, there is no way to solve


Reply to discussion (solution)

Contact your server administrator to set permissions for your site's program directory individually

You must have seen it too fast upstairs.
What I want to ask is, is there any solution in the procedure?

Uploading a file by default is Apache's permission, generally www-data is the owner.
View Phpinfo (); See if Disable_functions has chmod, if it is blocked.
If chmod is not in disable_functions, it means that there is no mask and should be available.

Www-data upload files, you are the owner, it is impossible to have no permissions.
At least PHP has permission to read and write.

Www-data upload files, you are the owner, it is impossible to have no permissions.
At least PHP has permission to read and write.



1, chmod () is disabled
2, the file upload, permissions such as: (If there is permission, is it my PHP code to write a problem?) )

The owner is not able to rw it?
See what the owner is?

At least how much permissions are set, and browser access to normal browsing?

Window under test upload pictures, put on Linux is-rw-r--r--permissions
This can be accessed normally

View and modify permissions for the images directory with FTP software

View and modify permissions for the images directory with FTP software


Images was 755, and now it's 777.
The permissions for the uploaded picture file are-rw-------

Change to 666

Change to 666


It's not going to change to 666. Now the question should be on the permissions on the file

Before September 2 is the win environment upload, no problem
Upload to Linux space after number 5th, no Read permission
In addition, the Linux php file upload, the default is-RW-------it?

What is the owner?

What is the owner?


Does it have to go into the Linux system to see the owner?
Under normal circumstances, who is the owner of the uploaded file?

/** gets the owner of the file or folder, the group user, and the permissions * @param  String $filename * @return Array *  /function File_attribute ($filename) {        if (!file_exists ($filename)) {          return false;      }        $owner = Posix_getpwuid (Fileowner ($filename));      $group = Posix_getpwuid (Filegroup ($filename));      $perms = substr (sprintf ('%o ', Fileperms ($filename)), -4);        $ret = Array (          ' owner ' = ' = ' $owner [' name '], ' group ' and ' = '          $group [' name '],          ' perms ' = = $perms      ); C13/>return $ret;    

/** gets the owner of the file or folder, the group user, and the permissions * @param  String $filename * @return Array *  /function File_attribute ($filename) {        if (!file_exists ($filename)) {          return false;      }        $owner = Posix_getpwuid (Fileowner ($filename));      $group = Posix_getpwuid (Filegroup ($filename));      $perms = substr (sprintf ('%o ', Fileperms ($filename)), -4);        $ret = Array (          ' owner ' = ' = ' $owner [' name '], ' group ' and ' = '          $group [' name '],          ' perms ' = = $perms      ); C13/>return $ret;    


It's a million-net.
Warning:posix_getpwuid () have been disabled for security reasons in .....
Array ([owner] = [Group] = [perms] +-600)

Shielding so much.

?? is a 600 limit. All of them? The file. That's weird.

It's still not there. Warning:chmod () had been disabled for security reasons In/data/home/qyu1297580001/htdocs/product/admin/func /upload.inc.php on line 66
OK this solution

  • 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.