douxing9567 2016-06-21 13:28
浏览 25

Ubuntu Server无法在PHP中创建目录

I have setup a little Ubuntu Server for developing some web apps.

I have a little script that uses mkdir() to create a directory, but i am getting a permission denied, its a simple command

mkdir($directory);

The error that im getting is

[Tue Jun 21 22:27:25.079075 2016] [:error] [pid 21150] [client 192.168.0.8:55413] PHP Warning:  mkdir(): Permission denied in .........

Im also getting permission denied for a few other commands like ftp_get()

When i check the phpinfo() the upload_tmp_dir is set to no value.

I am not very good at server admin so any help would be greatly appreciated.

I setup the server from a tutorial, then setup my virtual host from another tutorial.

Thanks Guys :)

  • 写回答

1条回答 默认 最新

  • douzhi9635 2016-06-21 14:00
    关注

    you need to confirm that the user starting the PHP service has permission to write to the directory,if not. you can try command sudo chown -R php_user /which_directory_you_want_to_mkdir, than inout root password and run program again. Good luck.

    My English is not very good, sorry

    评论

报告相同问题?