Cloud Service >> Knowledgebase >> DirectAdmin >> How to Increase the Upload Size for DirectAdmin File Manager?
submit query

Cut Hosting Costs! Submit Query Today!

How to Increase the Upload Size for DirectAdmin File Manager?

 DirectAdmin File Manager

Increasing the upload size for DirectAdmin File Manager involves adjusting several settings within both DirectAdmin and the server to accommodate larger file uploads. This process is crucial for users who need to manage and upload large files directly through the DirectAdmin File Manager. Below is a comprehensive guide to achieve this:

What is DirectAdmin

What is DirectAdmin

DirectAdmin is a web hosting control panel. It allows users to manage their websites easily. The File Manager is a tool that lets users: 

 

- Upload

- Edit

- Delete

- Manage their files on the server

 

There are limitations on the maximum file size that can be uploaded via the File Manager. The server's PHP configuration and the DirectAdmin settings often dictate it. 

Key Configuration Files

To increase the upload size, you need to modify the following configuration files:

1. php.ini

This file contains the PHP configuration settings.

2. directadmin.conf

This file contains the DirectAdmin configuration settings.

Modifying the PHP Configuration

The PHP configuration file (php.ini) controls several parameters related to file uploads. To increase the upload size, you need to adjust:

 

Modifying the PHP Configuration

1. upload_max_filesize

This sets the maximum size of an uploaded file.

2. post_max_size

This sets the maximum size of POST data that PHP will accept. It should be larger than upload_max_filesize.

3. memory_limi

This sets the maximum amount of memory a script can consume. It should be larger than post_max_size.

Steps to Modify php.ini

Steps to Modify php.ini

1. Locate the php.ini File

The location of the php.ini file depends on your server setup. 

Common locations include 

- /etc/php.ini,

- /usr/local/lib/php.ini,

- /etc/php/7.x/apache2/php.ini (for PHP 7.x versions).

2. Edit the php.ini File

Open the php.ini file in a text editor. 

You can use a command-line editor like nano or vim or edit it via an FTP client.

3. Update the Settings

Find and update the following settings:

upload_max_filesize = 64M

post_max_size = 128M

memory_limit = 256M

Adjust the values according to your needs.

4. Restart the Web Server

After changing php.ini, restart your web server to apply the new settings.

Use the following commands:

sudo service apache2 restart    # For Apache

sudo service nginx restart      # For Nginx

Modifying DirectAdmin Configuration
Modifying DirectAdmin Configuration

In addition to the PHP settings, you must update the DirectAdmin configuration to allow larger file uploads.

Steps to Modify directadmin.conf

1. Locate the directadmin.conf File

The directadmin.conf file is usually in the /usr/local/directadmin/conf/ directory.

 

2. Edit the directadmin.conf File

Open the directadmin.conf file in a text editor.

 

3. Add or Update the Following Settings

maxfilesize=64

It specifies the maximum file size that can be uploaded through the DirectAdmin File Manager.

 

4. Save the Changes and Restart DirectAdmin

After updating the directadmin.conf file, save the changes and restart DirectAdmin to apply the new settings:

sudo service directadmin restart

Verifying the Changes

Verifying the Changes

After making the necessary changes, you should verify that the new upload size limits are in effect.

1. Check PHP Info

Create a PHP file (e.g., info.php) with the following content:

Upload this file to your web server and access it through your web browser 

Look for the:

upload_max_filesize

post_max_size,

memory_limit settings

Ensure they reflect the new values.

2. Test File Upload

Use the DirectAdmin File Manager to upload a file close to the new upload size limit. Ensure that the upload completes successfully without any errors.

Troubleshooting

If you encounter issues after increasing the upload size, consider following troubleshooting steps:

1. Check Error Logs

Review the web server and PHP error logs for any clues about what might be causing the problem. 

Common log locations include

/var/log/apache2/error.log for Apache

/var/log/nginx/error.log for Nginx.

2. Verify Settings

Double-check that the php.ini and directadmin.conf files were edited correctly, and there are no typos.

3. Adjust Timeouts

Extensive file uploads can take longer to complete

Ensure that the max_execution_time and max_input_time are set to adequately high values. It should be able accommodate large uploads:

To Sum it Up!

 

To increase the upload size for DirectAdmin File Manager, one has to make changes to the PHP and DirectAdmin files. This way, after expanding the upload_max_filesize, post_max_size, and memory_limit in php, ini and the maxfilesize setting in DirectAdmin. In conf, you can be sure that your DirectAdmin File Manager can process big files for uploading. It is always advisable to restart the web server and the DirectAdmin after making configuration changes to ensure that the changes have taken effect. If issues arise, consult the server logs and adjust related timeout settings.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!