Tip: Start typing to get instant search results.
Configuring PHP Parameters in DirectAdmin
During the management and maintenance of your website, you may encounter error messages related to PHP parameter limits. These typically appear when the default hosting values are not sufficient for your site’s needs — for example, limits during file uploads or the execution of resource-intensive processes. The most common parameters that require adjustment are:
Core PHP Parameters
memory_limit: The maximum memory allocated to PHP per request. A higher value allows more resource-intensive processes to run, but increases memory consumption per PHP process.
post_max_size: The maximum size of data that can be sent via an HTTP POST request. It must always be greater than or equal to upload_max_filesize. For example, if you set upload_max_filesize = 64M, then post_max_size must be at least 64M — otherwise uploads will fail even if upload_max_filesize has been set correctly.
upload_max_filesize: The maximum file size allowed when uploading via PHP. If this value is too low, uploading large files will fail.
max_execution_time: The maximum time (in seconds) that a script is allowed to run.
PHP parameters can be modified in two ways:
- PHP Selector: Through the DirectAdmin control panel, via the graphical interface.
- .htaccess file: By adding the appropriate directives directly to your site’s .htaccess file.
Method 1: Via DirectAdmin (PHP Selector)
This is the safest and easiest method, using the graphical interface.
- First, log in to DirectAdmin by navigating to domainname.tld:2222 and entering your username and password.
![]()
- To access the PHP settings, select “Select PHP version” from the “Extra Features” menu.
![]()
- Then, from the “Options” tab, you can configure the core parameters mentioned above (memory_limit, post_max_size, upload_max_filesize).
![]()
Method 2: Via the .htaccess file
Use this method if you need to configure parameters that do not appear in the graphical interface, such as max_input_vars.
Caution: Before editing your .htaccess file, make a backup copy. A syntax error can make your site inaccessible.
Add the desired lines at the end of the file:
# Maximum number of input variables php_value max_input_vars 40000 # Maximum POST request size php_value post_max_size 64M # Maximum file size during upload php_value upload_max_filesize 64M
What if I use both methods?
Settings in the .htaccess file override the PHP Selector settings for the folder in which the .htaccess file is located. We recommend using the first method described in this article for the parameters that appear in the DirectAdmin PHP Selector.


