无法使用mkdir创建文件夹 [英] Can't create a folder with mkdir

查看:698
本文介绍了无法使用mkdir创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境信息:
* Windows Vista
* PHP 5.2.9-2

Environment info:
*Windows Vista
*PHP 5.2.9-2

我正在做一个项目.假设它的名称简称为"project".我的用于用户交互的php文件位于

I'm working on a project. Let's say it's name simply "project". My php files meant for user-interaction will be found at

project/file.php

project/file.php

现在,我在其后面有一个数据库以及一些映射,这些映射通常包含类和配置文件.还有一张供用户使用的地图,我在其中存储他们可能上传的图像.例如:

Now, I have a database behind this and some maps, which contain classes and configuration files in general. There is also a map for the users, in which I store images they might upload. For instance:

project/files/Users/0/profilePic.jpg

project/files/Users/0/profilePic.jpg

该数字与数据库中的user_id对应.

The number corresponds with the user_id in the database.

我的register.php文件包含以下代码行:

My register.php file contains this line of code:

mkdir('/files/Users/'.$id)

$id变量是数据库中最大的ID号,再加上1.

The $id variable is the biggest id number in the database, plus 1.

但是它不起作用.我检查了文件夹,我拥有读写权限(我是计算机的管理员).

But it won't work. I checked the folders, I have both read and write permissions(I am admin on my machine).

我在做什么错了?

注意:有权告诉我,有更好的方法来组织此保留给那些可以给我有用帮助的人. :P

Note: the right to tell me there's a better way to organize this reserved to those who can give me a helpful answer. :P

推荐答案

这怎么办?

mkdir('c:/files/Users/'.$id)

这篇关于无法使用mkdir创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆