Poll

CWP PHP issue for files larger than 2MB

CWP
2 (66.7%)
WordPress
1 (33.3%)

Total Members Voted: 3

Author Topic: CWP PHP issue for files larger than 2MB  (Read 5723 times)

0 Members and 1 Guest are viewing this topic.

CWP PHP issue for files larger than 2MB
« on: December 17, 2019, 05:01:50 PM »
Good morning, please help me. I am trying to solve this problem for days.
Already tried the following ways:

I logged in to the root user of CWP7 and modified it in SIMPLE PHP.ini editor (PRINT)
https://prnt.sc/qc5gn9
https://prnt.sc/qc5fbs
I restarted the server and nothing.


I went to the desired site and modified the .htaccess
php_value upload_max_filesize 1024M
php_value post_max_size 1024M
php_value memory_limit 1024M
php_value max_execution_time 300
php_value max_input_time 300

And gave the following error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@*******.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

I deleted it, as it gave error.

I went to PHP wp-config.php WordPress installed and put:


Print: https://prnt.sc/qc5hvl

@ini_set( 'upload_max_size' , '1024M' );
@ini_set( 'post_max_size', '1024M');
@ini_set( 'memory_limit', '1024M' );

Nothing, nothing happened with the site, I only followed 2M

I signed in to CWP.user > Edit php.ini (PRINT) https://prnt.sc/qc5hch
memory_limit=1024M
upload_max_filesize=1024M
post_max_size=1024M
max_execution_time=300
display_errors=On
date.timezone=undefined
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
session.save_path=undefined
magic_quotes_gpc=Off

And it didn't work either. Please help me.

Offline
*
Re: CWP PHP issue for files larger than 2MB
« Reply #1 on: December 17, 2019, 11:05:10 PM »
So starting errors :D

1. Update .htaccess file

If your web server is using Apache and PHP is set as an Apache module, then you can add a few lines of code in your WordPress .htaccess file to increase the max upload size in WordPress.

To access your .htaccess file, connect to your server via FTP client and navigate to the folder where WordPress is installed. Open up .htaccess file in a code editor or Notepad and add the following lines.

Code: [Select]
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
This will define the max upload size in Megabytes. Replace the numbers as per your requirement. The max execution time and max input time are in seconds. The execution time defines the limit of time spent on a single script. Choose a number that is suitable for your site.

2. Edit Functions.php File
In some cases, you might not be able to access your .htaccess file or you are more comfortable editing WordPress theme files.

You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.

However, remember if you change the theme then max upload size will return to its default values until you edit the functions.php file of the new theme.

Code: [Select]
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

3. php.ini Option
This is a default file used to configure any application which runs on PHP. This file contains parameters required for file timeout, upload size, and resource limits. Access your WordPress root directory using SSH or FTP and look for a php.ini file. In some cases, this file is not visible to the other option would be to create a new file instead.

Open any text editor and create a new file. Copy the following code and save it as php.ini.

upload_max_filesize = 25M
post_max_size = 13M
memory_limit = 15M
increase upload size wordpress in php.ini file
Now, upload that php.ini file using SSH or FTP inside the same root folder.


4. Increase Upload Size in Multisite


If you are running WordPress multisite, then upload size can be increased from settings. This increase is dependent on your server settings. If your server is set to 20MB you cannot increase WordPress upload size to 25MB. However, if your server is set to 20MB your network setting is set to 15 MB then you can resolve the issue by increasing the upload size to 20MB.

wordpress multisite maximum upload file size

5. wp-config.php File
Another way of increasing the upload size in WordPress is to define the size parameter in the wp-config.php file. To do that, access your WordPress root directory using SSH or FTP and locate a wp-config.php file.

wp-config.php

Open the file in any text editor and add the following code.
Code: [Select]
@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );
Save your changes and it should increase your file upload size.

Or if all of this not working just restart the server!
And dont put to big numbers :)