php chmod() not changing permissions

后端 未结 4 1407
既然无缘
既然无缘 2021-01-12 04:43

I am having problems with a picture uploading script.

I know there are hundreds of the same questions, but I haven\'t found the one that would be work for me.

<
4条回答
  •  醉话见心
    2021-01-12 05:01

    The directory must be owned by the user invoking the script (typically www-data, apache or httpd if you're running the script in a apache/*NIX setup). A user can't set 777 permissions on directories it doesn't own.

    See the note on the chmod() manual:

    The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The mode can be changed only by user who owns the file on most systems.

提交回复
热议问题