How do I upload a file larger than 10MB without having access to php.ini?

Asked

Viewed 250 times

4

Here’s what it is: My free file hosting gives me access to see information from the php.ini file, but I can’t modify it, I’ve tried creating a php.ini folder in the php.ini folder htdocs but it didn’t help, I tried to add this to .htaccess and it didn’t work:

php_value upload_max_filesize 40M
php_value post_max_size 42M

PHP Info information that might be useful:

Propriedade                       Valor original    Valor do servidor
================================= ================= =================
file_uploads                      On                On
max_execution_time                20                30
max_file_uploads                  20                20
post_max_size                     20M               20M
upload_max_filesize               10M               10M
upload_tmp_dir                    /tmp              /tmp
session.upload_progress.cleanup   On                On
session.upload_progress.enabled   On                On
session.upload_progress.freq      1%                1%

I just need to upload with more than 10mb, but my hosting doesn’t allow more than that. What can I do?

  • depending on the server, you can do a .user.ini instead of . htaccess - it depends on how PHP was configured (whether it’s a module or fcgi). In this case the format of the config line within this ini would be upload_max_filesize = 20M for example.

  • So it turns out that the php.ini file is hidden inside the hosting internal server and I don’t have access to it. The information was collected through "PHP Info" in cPanel.

  • the .user.ini is read in the PHP folder when the option is enabled and runs as fcgi - it would be an "equivalent" of . htaccess when PHP is not a module. http://php.net/manual/en/configuration.file.per-user.php

  • I’m sorry I’m ignorant, but how do I see if the file is enabled? It works like php.ini?

  • I found the properties user_ini.cache_ttl = 300 and user_ini.filename = ".user.ini". This means something?

  • 1

    Try creating a text file .user.ini with upload_max_filesize = 50M in the upload system folder, wait for 300 seconds and test if something has changed in the upload.

  • @Bacco tried and tried, it didn’t work... the file was created in the site root folder... :\

Show 2 more comments

1 answer

3


ini_set('post_max_size', '64M'); ini_set('upload_max_filesize', '64M');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.