Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

PHP upload limit

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

dev99

Established Member
Impact
7
Hi
I have a file upload script. Now the script works fine and the file upload limit in php.ini is set to 100mb. But i just tried to upload a 30 meg file, and it didnt upload. Is there any restriction in cpanel/whm stopping me from doing this.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
AFAIK, the limit has to be modified in two files; last time I did that personally on a cPanel server, I had to do it in two different places. I'll ask the tech that usually does that for me as soon as he gets back online.
 
0
Close
Thanks for the reply, i have read somewhere it has to be modified in two different places, but i cant remember where that it.
 
0
Close
100 Mb is rather huge unless the upload takes place on a LAN (intranet). The script may time out after a certain number of minutes. You can get round this with set_time_limit - if your host allows.
 
0
Close
php.ini and httpd.conf
 
0
Close
Watch out for server timeouts. You can set a certain timelimit (in milliseconds) for page timeout.

-Steve
 
0
Close
thanks everyone for the replies
Where would you set this script timeout limit, also, which httpd.conf do i edit, as i said, im on cpanel.
 
Last edited:
0
Close
in all honesty you would be far better off to get the uploads via ftp then use php to process the uploaded file.

HTTP was never meant for such large transfers.
 
0
Close
Well its quite a small site, i am really looking for a simple solution, which is why i bought the script.

Does anyone know how to modify the time limit.
 
0
Close
- which httpd.conf do i edit
usually httpd.conf on a CPanel system is located in /usr/local/apache/conf/
Don't forget to restart Apache after you modify httpd.conf (service httpd restart).

- how to modify the time limit.
in httpd.conf search for something like this:

Code:
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
 
0
Close
Thanks, is there any upload limit to change in httpd.conf.
 
0
Close
No upload limit in httpd.conf.

In php.ini you need to look to these variables:

Code:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
post_max_size =  55M ; Maximum size of POST data that PHP will accept.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back