Blog

File manager Upload error in CWP

Published on: June 9, 2021 by Scarlett Upton

File manager Upload error in CWP

Scenario:

While uploading a file of larger size in CWP using the file manager, you may encounter a file upload error as following in the log file /usr/local/cwpsrv/logs/error_log.

[otw_shortcode_info_box border_type=”bordered” border_color_class=”otw-blue-border” border_style=”bordered”]2021/05/24 04:20:58 [error] 2578322#0: *114 client intended to send too large body: 720059757 bytes, client: 117.203.36.77, server: localhost, request: “POST /cwp_7c0f4a5796597df4/testfil/testfil/index.php?module=filemanager&acc=uploadFiles HTTP/1.1”, host: “host.example.com:2083”, referrer: “https://host.example.com:2083/cwp_7c0f4a5796597df4/testfil/fileManager_v2.php”[/otw_shortcode_info_box]

The file shows as upload complete as in the below screenshot, but the file is not uploaded in the location.

upload complete

In the latest CWP versions like 0.9.8.1064, you get an error as following in the screenshot (you can see the file upload maximum limit already displayed).

Error Message

The CWP (Centos Web Panel) uses a different php.ini file to load the PHP configurations for the control panel interfaces. The /usr/local/cwp/php71/php.ini is the default PHP server configuration file of cwpsrv service for CWP admin panel, CWP user panel, phpMyAdmin, and Roundcube.

(The phpini file is the default configuration file for running applications that require PHP).

To solve this, you need to edit the CWP PHP configuration:

Step 1: On the command line, first backup the php.ini file.

[otw_shortcode_info_box border_type=”bordered” border_color_class=”otw-blue-border” border_style=”bordered”]cp /usr/local/cwp/php71/php.ini /usr/local/cwp/php71/php.ini.bak[/otw_shortcode_info_box]

Step 2: Edit the configuration file.

[otw_shortcode_info_box border_type=”bordered” border_color_class=”otw-blue-border” border_style=”bordered”]vi /usr/local/cwp/php71/php.ini[/otw_shortcode_info_box]

Step 3:  To upload a bigger file via File manager, you need to adjust the following PHP configuration directives.

Locate the following and change to your size and in this case, I am using 100MB for upload_max_filesize.

upload_max_filesize: By default this value is 64MM. You need to increase it to the maximum size of a single file that we want to upload.

post_max_size: It defines the maximum size of POST data that PHP will accept. This value should be greater than ‘upload_max_filesize’.

memory_limit: This sets the amount of memory a PHP script is allowed to use during its execution. Set this to a value greater than ‘post_max_size’ so that the PHP script can load and process the uploaded file.

max_input_time: This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins. This would include populating $_FILES superglobal.

max_execution_time: The time a script is allowed to run after its input has been parsed. This would include any processing of the file itself.

[otw_shortcode_info_box border_type=”bordered” border_color_class=”otw-blue-border” border_style=”bordered”]upload_max_filesize = 100M post_max_size = 150M memory_limit = 150M max_input_time = 90 max_execution_time = 90[/otw_shortcode_info_box]

Step 4: Save the file and restart CWP
[otw_shortcode_info_box border_type=”bordered” border_color_class=”otw-blue-border” border_style=”bordered”]sh /scripts/restart_cwpsrv[/otw_shortcode_info_box]

 

cPanel Server Management

Category : cPanel, Linux

Scarlett Upton

Scarlett Upton

“A Passionate Techie Who loves painting” Salma from the hilltop, Malappuram, who is an artist, was more passionate in IT than art. This passion made Salma to grab the Hottest International Certification in Open Source - RHCE, along with her eccentricity in painting. She is now working as System Engineer at SupportSages.

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Categories

Your Cart

Cart is empty.

Subtotal
₹0.00
APPLY
0
Send this to a friend