0

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.

Garrett
  • 203
  • 2
  • 5
  • 10

3 Answers3

1

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.

Prix
  • 4,881
  • 3
  • 24
  • 25
  • 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 09 '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 09 '10 at 19:58
  • i found `php.ini` inside `/etc`! thanks for your help! – Garrett Aug 09 '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 09 '10 at 20:52
0

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

Marco Demaio
  • 590
  • 1
  • 8
  • 23
0

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.