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

    评论

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口