Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i would like to be able to upload files larger than 64M. locally, i could set my php.ini file, but it looks like cPanel does not allow that, and rightfully so. i read that ini_set does not work for upload_max_filesize, so i am here asking the pros.

any ideas? thanks.

share|improve this question

closed as off-topic by Falcon Momot, Ward, dawud, MadHatter, Tim Brigham Sep 19 '13 at 17:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Falcon Momot, Ward, dawud, MadHatter, Tim Brigham
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

3 Answers

up vote 1 down vote accepted

upload_max_filesize can be rewriten by php.ini in user's directory if you have your cPanel using suphp.

It is usually under /home/domain/public_html if it is not there you can create your own in there.

Make sure you have suphp enabled on htttpd.conf aswell.

share|improve this answer
    
so, if i understand correctly, i need to: 1) make my own php.ini file inside /home/domain/public_html 2) enable suphp on httpd.conf great. now my only question is: where can i find httpd.conf? –  Garrett Aug 9 '10 at 14:03
    
if you are not the owner of the server you gona have to ask for you server provider if they use suPHP or you can simple try to put the php.ini on the public_html folder with the changes you need and then run the phpinfo from a php script to verify the server variable for a change, if it changed means you do have suPHP within your server. If you are the owner of the server, httpd.conf is usually at /etc/httpd/ or your can fun updatedb; locate httpd.conf –  Prix Aug 9 '10 at 19:58
    
i found php.ini inside /etc! thanks for your help! –  Garrett Aug 9 '10 at 20:45
    
/etc of your ftp or /etc within your system ? if it is within your ftp it is probably that your host does use suPHP but with a different path for the php.ini like yours. Hope that works out for you, best regards. –  Prix Aug 9 '10 at 20:52
add comment

I've found an easy way to change the upload_max_filesize through .htaccess

You onlye have to edit your .htacess (in root) an add the following lines

php_value upload_max_filesize 40M
php_value post_max_size 40M
php_value max_input_time 1000
php_value max_execution_time 1000

Notice that I chose 40MB ("40M") as upload limit, and time "1000", just to be sure that the time will be long enough to upload the file.

It worked for me.

share|improve this answer
1  
FYI: this will only work when php is loaded as an apache module aka DSO. –  SparX Sep 12 '11 at 23:07
add comment

In your public_html add these two files:

.htaccess (if it's already there, simply download it and add into it the following)

#Activates php.ini config located in main folder to work also recursively for all subfolders, obviously replace your_cpanel_user with your full path, you find it in cPanel home page on the left it's called 'Home Directory'
suPHP_ConfigPath /home/your_cpanel_user/public_html

php.ini

upload_max_filesize = 64M
; post_max_size 8M (this might need to be adjusted too)
; memory_limit 128M (this might need to be adjusted too)
; max_input_time -1 (this might need to be adjusted too)

Actually 64M is really huge to upload on a server without using FTP, the other variables I wrote in php.ini file might need to be set properly to bigger values (I left them commented out using ';'), you can readmore in here: http://it.php.net/manual/en/features.file-upload.common-pitfalls.php

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.