Remove the file upload size restrictions for various PHP spaces

Remove the file upload size restrictions for various PHP spaces

Of the following three methods, the first one succeeded, while the second and third ones failed.
1. If it is a VPS, you can modify php.ini directly. Open php.ini, search for the following configuration items (red characters), and then modify them as needed. You can use the reference values ​​below. Remember that you must modify the default configuration items after searching for the code, and you cannot copy and paste directly!

upload_max_filesize = 20m; //The maximum size of the uploaded file allowed
post_max_size = 20m ; //The maximum value that can be received by PHP through form POST
max_execution_time = 600; //The maximum execution time of each PHP page (in seconds)
max_input_time = 600; //The maximum time (in seconds) each PHP page waits for receiving data

2. If it is a Linux space, you can remove the restriction by modifying the .htaccess file. Open the .htaccess file in the root directory and add the following code. You can copy and paste it directly. Of course, you can also modify the relevant parameter values.

*The maximum size of the uploaded file allowed
php_value upload_max_filesize 20m
*The maximum value that can be received by PHP through form POST
php_value post_max_size 20m
*The maximum time (in seconds) for each PHP page to run
php_value max_execution_time 600
*The maximum time (in seconds) each PHP page waits for receiving data
php_value max_input_time 600

3. Modify the theme configuration file to remove the restriction, open functions.php with Notepad++, and add the following code between <?php and ?>:

@ini_set('upload_max_size', '20m'); // Maximum size of uploaded files
@ini_set('post_max_size', '20m'); //The maximum value that can be received by PHP through form POST
@ini_set('max_execution_time', '600'); //The maximum execution time of each PHP page (in seconds)
@ini_set('max_input_time', '600'); //The maximum time (in seconds) for each PHP page to receive data

<<:  Zyma – Free unlimited hosting for a year

>>:  $15/year/2G space/40G traffic virtual host——LevelHosting

Recommend

LetBox: $30/year/2GB memory/20GB NVMe+256GB space/2TB traffic/KVM/Los Angeles

LetBox, an American hosting company, has been int...

HostSailor: $15/year/512MB memory/20GB space/512GB traffic/Xen/Netherlands

HostSailor, a legitimate company, A224/03/14/8150...

V.PS 2 cores 1GB memory 1Gbps port Hong Kong KVM VPS review

Details : V.PS: €4.76/month/2 cores/1GB memory/20...

SimpleNode: $3/month/256MB memory/4GB SSD/500G bandwidth/KVM

Introduction SimpleNode is a hosting provider fou...

HOST4FUN:$7/year/256MB RAM/5GB storage/100GB bandwidth/OpenVZ/Dallas

HOST4FUN, a foreign hosting provider, has been in...

Onra Host: $4.5/month/768MB memory/30GB SSD/1TB bandwidth/Xen/Los Angeles

Onra Host has previously introduced its HHD hard ...

Introduction to Web Hosting Provided by Namecheap.com

Namecheap.com is a very good domain name registra...

Hostens: €4.99/month/2GB memory/40GB space/10TB traffic/KVM/Lithuania

Hostens, a European hosting provider, officially ...