免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1650 | 回复: 2
打印 上一主题 下一主题

Linix系统下php问题?(急) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-15 17:29 |只看该作者 |倒序浏览
1.创建目录:

我写了一个最简单的源码:
<?
mkdir("xzx";
?>;

出错信息如下:
Warning: mkdir(xzx): Permission denied in /www/web/ceby.com.cn/temp/makedir.php on line 2


2.上传文件:
  move_uploaded_file ( string filename, string destination)

以上两个函数我在winxp下运行成功,而在Linix下失败,
请问在Linix下创建目录及上传文件该如何实现?

谢谢解答!!

论坛徽章:
0
2 [报告]
发表于 2005-01-16 01:02 |只看该作者

Linix系统下php问题?(急)

shell>; cd /www/web/ceby.com.cn
shell>; chmod 777 *

论坛徽章:
0
3 [报告]
发表于 2005-01-16 13:59 |只看该作者

Linix系统下php问题?(急)

我将源码改写成(makedir.php):

<?
mkdir("xzx",777);
?>;


<?
shell_exec("shell>; cd /www/web/ceby.com.cn/temp/";
shell_exec("shell>; chmod 777 *";

mkdir("xzx";

?>;


还是出来同样的警告信息:
Warning: mkdir(xzx): Permission denied in /www/web/ceby.com.cn/temp/makedir.php on line 2


还有上传文件也不行(upfile.php):

<?
$pic=$_FILES['pic'];
$p=strrpos($pic['name'],".";
if($p)
  move_uploaded_file($pic['tmp_name'],$pic['name']);
?>;

<form enctype="multipart/form-data" action="upfile.php" method="post">;
  <div align="center">;
  图片<input type="file" name="pic">;<p>;
  <input type="submit" value="ok">;
  
</div>;
</form>;

运行后出现警告信息:
Warning: move_uploaded_file(4.gif): failed to open stream: Permission denied in /www/web/ceby.com.cn/temp/xzx/upfile.php on line 14

Warning: move_uploaded_file(): Unable to move '/var/tmp/phpS3TMwA' to '4.gif' in /www/web/ceby.com.cn/temp/xzx/upfile.php on line 14

请问我应该如何通过代码实现目录的创建及文件的上传(服务器为Linix系统的虚拟主机)?

谢谢解答!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP