Published on: June 9, 2021 by Scarlett Upton
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.
The file shows as upload complete as in the below screenshot, but the file is not uploaded in the location.
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).
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 php. ini 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.
Step 2: Edit the configuration file.
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.
Category : cPanel, Linux