PHP无法打开上传的文件 [英] PHP can't open uploaded files

查看:120
本文介绍了PHP无法打开上传的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带灯的Ubuntu服务器.
当我上传xls或图像之类的文件时,它可以正常工作,但是当我尝试打开它时,则表明Excel文件已损坏.图片也会发生同样的事情

I have Ubuntu Server with lamp.
When i uploading files like xls or images it works fine, but when I trying to open it says me that the Excel file was broken. Same thing happens with images

php是否有可能更改文件?

/var/www/publick_html/uploads的权限为777

Is it possible that php changes the file?

Permissions for /var/www/publick_html/uploads is 777

推荐答案

问题出在apache和php版本中. 阿帕奇的版本是2.2和php是5.4 我将apache升级到2.4版本,现在可以正常工作了.

The problem was in versions of apache and php. Version of apache was 2.2 and php was 5.4 I upgraded my apache to 2.4 version and now it works fine.

这篇关于PHP无法打开上传的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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