简体   繁体   中英

File UPLOAD error -> Trying access the php.ini file into the OPENSHIFT free application and get Permission Denied response

I'm trying to save a file into the serverusing the statements below but it doesn't work! I heard I would need to access the php.ini file but it says I don't have permission... What should I do to solve it???

move_uploaded_file($_FILES['file_0']['tmp_name'], 'uploads/'.$data['filename'])

But used this way earlier and seems it didn't work too...

move_uploaded_file($_FILES['file_0']['tmp_name'], '$_SERVER['DOCUMENT_ROOT'].'uploads/'.$data['filename']

In case there is a certain directory where II can have the write permission, please tell me(would help me a lot too).

刚刚找到了答案...首先是目录权限...在openshift中,使用$ _ENV ['OPENSHIFT_DATA_DIR']作为根是明智的。...此外,我还没有创建“ / uploads / “文件夹...我认为move_uploaded_file()函数会创建它(如果还没有的话),但是我错了。。只是使用了mkdir命令和voulá

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM