我是一个PHP的n00b,但按照说明按本优秀的啧啧:PHP错误:未能打开流:没有这样的文件或目录
PHP Tizag file upload tutorial
然而,尽管这在我运行默认的内置Apache的Mac(OSX 10.8)上完美运行,它失败并且不能在CentOS 6机器上运行。翻翻Apache日志我得到这个:
failed to open stream: No such file or directory
权限已被设置为的“上传”文件夹位于的/ var/www/html等根(在Mac上它的/ Library/Webserver/Documents)
[Tue Apr 30 13:05:11 2013] [error] [client (My IP Address)] PHP Warning: move_uploaded_file(uploads/Today notes.txt): failed to open stream: No such file or directory in /var/www/html/test/uploads3.php on line 8, referer: ht*p://serverip.myserver.com/test/form4.html
[Tue Apr 30 13:05:11 2013] [error] [client (my IP address)] PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpc8AGo8' to 'uploads/Today notes.txt' in /var/www/html/test/uploads3.php on line 8, referer: ht*p://serverip.myserver.com/test/form4.html
我是否缺少PHP或Apache中的一些设置以使其正常工作?
非常感谢提前。
您可以显示PHP代码中使用 – fullybaked 2013-04-30 12:26:19
如果你有问题了Tizag教程,请联系Tizag寻求支持。是的,只要你得到错误,你就错过了一些东西。要了解什么,请阅读错误消息并尝试理解它们。 – 2013-04-30 12:31:57
传递文件路径时请记住区分大小写,容易忘记mac是不区分大小写的,其中cent os将区分大小写。 – AlexP 2013-04-30 12:41:04