0

I have to upload photos that are about 5-10mb each,but the default maximum size is 2mb. I've searched in google and found that you have to edit the php.ini file and increase the amount. However, when I go into my Cpanel, I cannot find php.ini, but there is phpsample.ini If I go into this phpsample.ini, there is no code that has the maximum file size. is there any other solution to fix this problem? Thanks!

1
  • ask your host, they will do for you or will tell you where to access php.ini file Commented Aug 31, 2017 at 4:49

2 Answers 2

0

You need to check your php settings for the values set.

You can create phpInfo.php and paste the below code in it

<?php echo phpinfo(); ?>

This will give you full info of your settings. You can check the values for

upload_max_filesize = 2M
post_max_size = 2M

You can increase this values and restart your server. To know which php file you are using look for the below detail

Loaded Configuration File /etc/php/7.0/apache2/php.ini

If you are using shared hosting you need to contact your server administrator.

You can also try adding this code in your script file

ini_set('upload_max_filesize', '5M');
ini_set('post_max_size', '5M');
0

Just update php.ini settings:

memory_limit = 32M

upload_max_filesize = 24M

post_max_size = 32M

And don’t forget to restart your server afterwards.

Hope this will work!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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