Chmod () is disabled on the server. how can this problem be solved?

Source: Internet
Author: User
The chmod () function is disabled on the server. how can I disable the chmod () function on the server?
You do not have the permission to upload a file.
If the server configuration is not changed, is there any solution in the program?


Reply to discussion (solution)

Contact the server administrator and set separate permissions for your website Program Directory.

The upstairs must have seen it too fast.
I want to ask, is there a solution in the program?

By default, the apache permission is used to upload files. generally, www-data is the owner.
Check phpinfo (); check whether disable_functions has chmod. If yes, it is blocked.
If chmod is not in disable_functions, it indicates that it is not blocked and should be usable.

Www-data is the owner of uploaded files, and it is impossible to have no permissions.
At least php has the permission to read and write.

Www-data is the owner of uploaded files, and it is impossible to have no permissions.
At least php has the permission to read and write.



1. chmod () is disabled.
2. after the file is uploaded, the permission is as follows: (If you have the permission, is there a problem with my php code ?)

Can the owner rw?
What is the owner?

What are the minimum permissions that can be browsed normally during browser access?

The image uploaded during the test in window is-rw-r -- permission after it is placed in linux.
This can be accessed normally

Use ftp to view and modify the permissions of the images Directory

Use ftp to view and modify the permissions of the images Directory


It was 755 before images, but it still cannot be changed to 777 now.
The permission for uploading image files is-rw -------

To 666

To 666


It cannot be changed to 666. The problem is that the file permission

It was uploaded in the win environment before December 31, September 2. No problem
Uploaded to the linux space after the 5th day, and thus has no read permission
In addition, is the default PHP file-rw ------- used for uploading in linux?

What is the owner?

What is the owner?


Do I have to enter the linux system to see the owner?
Under normal circumstances, who is the owner of the uploaded file?

/** Get the owner, group user, and permission of a file or folder * @ 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' => $ group ['name'], 'perms' => $ perms ); return $ ret ;}

/** Get the owner, group user, and permission of a file or folder * @ 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' => $ group ['name'], 'perms' => $ perms ); return $ ret ;}


It is indeed HiChina
Warning: posix_getpwuid () has been disabled for security reasons in ............
Array ([owner] => [group] => [perms] =>-600)

It is much shielded.

?? Is it 600? Limits. All already? Yes ?? File. It's really strange.

Still not finished, there is still Warning: chmod () has been disabled for security reasons in/data/home/qyu1297580001/htdocs/product/admin/func/upload. inc. php on line 66
OK.

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.