The question is: there is a script (file manager). The problem is that with the help of the script I cannot change the chmod - it writes

Warning: chmod () [function.chmod]: Operation not permitted in / home / bla bla ........

Through the Commander I put the attributes 0777 on all the files and directories that the script "oversees". Vserovno does not help.

But, with the files and directories created by the script itself - no problem. As far as I understand, the problem is with the owner's UID. But I put the attributes Commander - -0777 (of the type without restrictions .....) and does not plow all the same.

By the way! Stopped chown () - also issued by Operation not permitted.

Prompt good people - how to deal with this "nafig"?

  • do you log in as root? - tukan
  • Well, if through ftp-commander you can delete and create anything, you probably. And the admin is tied to the same uch.zapisi .. - DaySiS
  • Apache running on behalf of the same user as the ftp server? The directory where your files are located should belong to the user on whose behalf Apache is running. Naturally he will need rights to write. - Dex

3 answers 3

In php it is not strong, but apparently you should change the owner / group for all the directories where it works with the files on the user from whom the execution is going. Using the commands chown , chgrp .

By the way! Stopped chown () - also gives Operation not permitted (((

This may be if the directory level above is not writable. You should either change the owner and set at least rwx------ , or simply set rwxrwxrwx so that anyone could write, which is not recommended.

  • It doesn't help ((((The funny thing is that the script itself can crash any file or directory with all its contents, BUT there are no rights to change rights))) The directory where the script is located is at the next level from the root and it has 0777 - DaySiS
  • And maybe php prohibited these functions? - Dex
  • Is it at least linux? - Vladimir Gordeev

Standard situation for example on the masterhost. The web server works from www-data , the scripts respectively, too, but FTP / SSH works from u123143 . In addition, PHP can be enabled for example safe mode or stand umask.

If you have two www / mydir directories and the www directory is not the owner of www-data (which happens most often), then it’s likely that you will not be able to change any attributes of the file list inside this directory. In any case - rightly noticed here, you need to make two files (directories) from the script and the console and see ls -la

    Create a file from a commander and create a file with a script. See who owns each file. I think from under the commander you will have root, and the script probably is probably the owner under the name of "appach" or something else. I had such a trawl. I had to write a hoster to open access for two owners to manage all files.