How to Increase upload_max_filesize for wordpress on Linux/cPanel Server
How to Increase upload_max_filesize for your WordPress/Magento/Joomla website on Linux/cPanel Server
Go to document root of your website and create one phpinfo.php file.
[root@server ~]# vi phpinfo.php
Enter the below content in phpifnfo.php file and save the file.
< ?php phpinfo(); ? >
[root@server ~]# chown user:user phpinfo.php
Now try accessing the phpinfo.php file in the browser to check the current upload_max_filesize value of your website. In the below screenshot you can see that upload_max_filesize of my website is 2M. To change the upload_max_filesize first you must check the loaded php.ini of your website.
php configuration of my website is in /usr/local/lib/php.ini. This is the server php.ini file and modifying any values in it will affect all the domains on the server. Create a custom PHP for your website and then edit the upload_max_filesize value. Do the below steps to create a custom php.ini file for your website.
Copy the php.ini file of your server to the document root of your website and then change the ownership of the file.
[root@server ~]# chown user:user php.ini
Try accessing the phpinfo.php file in web browser to make sure custom php is loaded.
Edit php.ini using vi editor and change the upload_max_filesize value to 30M (Any value)
Save the file and exit. Restart web server on the server and then check upload_max_filesize value in the phpinfo.php file.
How to Increase upload_max_filesize server-wide for all Domains
Log into your Linux server via SSH as root. Type the command “php –ini” to check the loaded php configuration file.
Configuration File (php.ini) Path: /etc
Loaded Configuration File: /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed: /etc/php.d/curl.ini,
php.ini file of my website is in /etc/ directory. Edit the php.ini file using vi editor and change the upload_max_filesize.