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!
2 Answers
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'); 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!!