试图上传视频文件在PHP中,但它太大了 [英] Trying to upload video file in php, but it's too large

查看:603
本文介绍了试图上传视频文件在PHP中,但它太大了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用html文件输入标签将视频上传到运行在wamp 2.2服务器上的php 5.3.10脚本。我发现它不会上传,显然它太大了。



我已经进入php.ini并将以下内容更改为100M:post_max_size,upload_max_filesize
$ b 和memory_limit是在128 MB。我重新启动WAMP并尝试上传文件,但仍然没有上传。然后,我清除了我的缓存和历史记录,重启了wamp,但仍然无法工作。然后,我清除了缓存,关闭了wamp,关闭了我的电脑,然后重新启动,开始wamp,但仍然无法正常工作。



尝试上传大约是25 MB。

尽管我在php.ini中进行了更改,但是Apache错误日志不断发布此错误,每当我尝试上传此视频时:

[错误] [客户端127.0.0.1] PHP警告:POST内容长度26246222个字节超过了第8行的限制8388608字节, a href =http://localhost/uploadFile.html =nofollow> http://localhost/uploadFile.html



另外一个php脚本,如下所示:
$ b

echo ini_get('upload_max_filesize'),,,ini_get('post_max_size'),,,ini_get('memory_limit' ):打印出来:100M,8M,128M

因此,似乎post_max_size是问题所在,尽管我在php.ini中设置为100M



可能是什么问题?如何解决这个问题?...

这是我的php.ini文件的内容的链接,这个文件位于C:\wamp\bin\\下\\ phppc \ php5.3.10:



http:// pastebin。 com / RUVE093u

解决方案

在C:\wamp\bin\apache\apache2 .2.x\bin\php.ini

 查找:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

更改为:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M


$ b 然后重新启动wamp。

I'm trying to use a html file input tag to upload videos to a php 5.3.10 script running on a wamp 2.2 server. I found that it won't upload and apparently it is too big.

I have gone into php.ini and changed the following to 100M: post_max_size, upload_max_filesize

and memory_limit is at 128 MB. I restarted WAMP and tried to upload the file, but it still did not upload. I then cleared my cache and history and restarted wamp, and it still didn't work. I then cleared the cache, turned off wamp, turned off my computer and then started up again, started wamp, and it still didn't work.

The video I am trying to upload is about 25 MB.

Inspite of the changes I made in php.ini, the Apache Error Log keeps posting this error, everytime I try to upload this video:

[error] [client 127.0.0.1] PHP Warning: POST Content-Length of 26246222 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer: http://localhost/uploadFile.html

Also a php script with the following line:

echo ini_get('upload_max_filesize'), ", " , ini_get('post_max_size'), ", ", ini_get('memory_limit'): prints out: 100M, 8M, 128M

So it seems that it is the post_max_size that is the problem, eventhough I set to 100M in php.ini

What could be the problem? How do I solve this?...

Here is a link to the contents of my php.ini file, which is under C:\wamp\bin\php\php5.3.10:

http://pastebin.com/RUVE093u

解决方案

Try these settings in C:\wamp\bin\apache\apache2.2.x\bin\php.ini

Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

Then restart wamp.

这篇关于试图上传视频文件在PHP中,但它太大了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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