Permission denied on mkdir()

江枫思渺然 提交于 2019-12-01 03:59:24

is_writable() is probably the function you're looking for.

http://cz.php.net/manual/en/function.is-writable.php says:

Returns TRUE if the filename exists and is writable. The filename argument may be a directory name allowing you to check if a directory is writable.

Also, the directly next line is relevant here:

Keep in mind that PHP may be accessing the file as the user id that the web server runs as (often 'nobody').

In other words, check if your directory is writable by the user id of the web server - this may be a different user id than yours! Set the appropriate permissions - e.g. set the usergroup of the folder to that of the server's user, and grant read, write, and execute to group. (chgrp somegroup uploads; chmod g+r uploads; chmod g+w uploads; chmod g+x uploads)

Make sure the parent folder is writable to the process that the web server runs as.

Edit: Oops, premature reply. Does your host give you a GUI file browser thingy?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!