Change PHP settings for hosting package
Sometimes it is necessary to change PHP settings. For example, if the maximum upload size gives an error on the website. The error message often refers to the php.ini file. These PHP settings can be adjusted in DirectAdmin.
This explanation is about PHP settings for the entire package. Do you want to change the PHP version per domain? Then you can find more info here: Change PHP versions
At mijn.host, there are 2 methods for this PHP selector to change the php.ini settings of your hosting package. We have divided this into:
- The simple method
This method requires little technical knowledge, and you can easily perform the steps in your hosting package via DirectAdmin. However, with this method, you cannot change all php.ini settings, but you can change the most common ones. In most cases, this method will be sufficient. - The advanced method
With this method, you can basically change all php.ini settings, but this requires a bit more technical knowledge.
Method 1: The simple method
With this method, you can easily change the most common php.ini settings in your hosting package via DirectAdmin. The php.ini settings you can change with this are turning extensions on or off. And also multiple options such as:
- disable_functions
- display_errors
- error_reporting
- max_execution_time
- max_input_time
- max_input_vars
- memory_limit
- post_max_size
- sys_temp_dir
- upload_max_filesize
- upload_tmp_dir
- Log into DirectAdmin. To do this, read this article.
- Search for PHP in the search bar and select “Select PHP version”.
- If you want to change the PHP version first, you can do so on this page. Then select the current PHP version and change it to the desired version in the dropdown.
- To change the options within PHP (php.ini), press the “Options” tab. Here we can change the PHP settings.
- For example, to change the “upload_max_filesize” specification, we click on the dropdown here. The changed value automatically saves itself. A pop-up will then appear in the top right. The change is now active.
Method 2: The advanced method
With this method, you can basically change all php.ini settings in your hosting package, but this requires some technical knowledge. To do this, you need to connect to your hosting package via SSH.
- Connect to your hosting package via SSH. In this article we explain how to make a connection via SSH.
- As soon as you are connected via SSH, type the following command:
nano /etc/cl.php.d/alt-php81/alt_php.iniDetails
Replace php81 with the desired PHP version (in this case PHP 8.1). - Go to the bottom line in the file and type your desired php.ini settings per line.
- Save the file using Ctrl + X
Still have questions? Get in touch.