duanruoyu6675 2010-09-14 21:47
浏览 48
已采纳

Apache文件夹权限

When I create a directory with PHP's mkdir(), the folders' owner is 'apache'. When I create a directory over FTP, the owner is 'ftpadmin'.

For some strange reason, with PHP's rename() function I can't move any files into a directory owned by 'apache'. I've chmod() both the file and the directory to 777 and 0777, but 'apache' refuses to move any files into directories it created. I can have 'apache' move files into an 'ftpadmin' directory. I've tried chmod() and mkdir() with 777, 0777, 755, 0755, 1777, 01777 and more.

The directories need to be dynamically generated by my client, and files need to be moved in and out.

The server is a dedicated-virtual server that I have can ssh into and have admin rights to.

  • 写回答

2条回答 默认 最新

  • dongtan6543 2010-09-15 00:07
    关注

    Perhapse safe-mode features? http://www.php.net/manual/en/features.safe-mode.functions.php

    rename() Checks whether the files or directories being operated upon have the same UID (owner) as the script that is being executed. Checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed.

    If safe mode is on, turn it of, and solve the functionality it provides at a proper level. If this isn't the problem, showing the actual error php undoubtedly emits could help us a lot.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序