Jump to content

Recommended Posts

Hey guys!

 

I'm trying to upload a file, it works well with smaller files but with 60mb+, I get a POST size error even though I've raised POST max size:

 

ini_set( 'post_max_size', '500M' );

 

This error is saved as an error log:

[09-Jan-2010 22:58:16] PHP Warning:  POST Content-Length of 64635880 bytes exceeds the limit of 16777216 bytes in Unknown on line 0

 

In "Unknown"? Haha! Wooo! Where am I supposed to look for?

I guess I should raise POST limit directly in php.ini then?

 

Thanks for the advises!

Link to comment
https://forums.phpfreaks.com/topic/187884-big-file-upload/
Share on other sites

post_max_size

 

You can also use .htaccess

php_value upload_max_filesize 100M

php_value post_max_size 100M

 

if you still have problems you will have to increase the memory available to php

php_value memory_limit

Theoretically it should be larger that the file you are posting...but you probably dont have that much in the server. YMMV.

 

 

HTH

Teamatomic

Link to comment
https://forums.phpfreaks.com/topic/187884-big-file-upload/#findComment-991975
Share on other sites

Nope, it's a dedicated server...

 

Well, it seems like I'm having an hard time getting a .htaccess file on there.

Whether I create it from an FTP client, upload it from an FTP client, create it from cPanel or upload it from cPanel... the file doesn't appear?

 

:confused:

 

EDIT:

 

HohOH? What is that?:

 

<?php 

ini_set( 'upload_max_filesize', '500M' );
ini_set( 'post_max_size', '500M' );
ini_set( 'memory_limit', '500M' );

phpinfo();

 

post_max_size and upload_max_filesize haven't changed, memory_limit did however?

 

 

Link to comment
https://forums.phpfreaks.com/topic/187884-big-file-upload/#findComment-991999
Share on other sites

You cannot use an ini_set() in your script for the upload size settings because the settings are used by php before your script is ever executed (which is why the error message reports that error is occurring in Unknown on line 0.)

 

If you have a dedicated server, why not make the change in the master php.ini?

 

The leading dot in the .htaccess file name is there to make it so that you cannot normally see the file.

 

Also, you can only put php settings in to a .htaccess file when php is running as an Apache Module. If php is running as a CGI application, you would need to use a local php.ini. If php is running as anything else then these two combinations, you must use the master php.ini.

 

 

Link to comment
https://forums.phpfreaks.com/topic/187884-big-file-upload/#findComment-992003
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.