How to Change PHP Settings?

The scripting language PHP is frequently utilised online. Several settings in PHP can be changed by the user themself, and it is very customizable. Your php.ini file’s PHP settings can be modified using the instructions in this article.

Why?

You may need to change your PHP settings, as you maybe encountering one of many error codes, and you possibly can’t access your website, until you resolved the error. You may want to backup your website before continuing.

You may check your current PHP settings by making a file called phpinfo (phpinfo.php) and pasting the code below into it.

				
					<?php phpinfo() ?>
				
			

Then visit your website; for example: https://your-domain.com/phpinfo.php

Method 1 – modify PHP.ini

If you can’t find the PHP.ini file, you can create the file yourself. Some hosts do not allow users to access the PHP.ini file. In this case, you can try the .htaccess method.

You can create a new file named PHP.ini in the directory where your WordPress website is installed, normally (public_html). Once you have the file, please follow the instructions:

Step 1 – Open the file using the code editor;

Step 2 – Add the following values:

				
					memory_limit = 512M;
max_execution_time = 900;
max_input_time = 900;
post_max_size = 256M;
upload_max_filesize = 256M;
				
			

Step 3 – Save the file.

If that doesn’t work, try method 2.

Method 2 – modify .htaccess file

You can modify your PHP configuration also by using the .htacces file. Keep in mind that the .htaccess file may be hidden, so once you access your root directory using the FTP client, make sure you check the folder for the hidden files. 

To modify the file, follow these steps:

Step 1 – Open the file using the code editor;

Step 2 – Add the following values:

				
					php_value memory_limit 512M
php_value max_execution_time 900
php_value max_input_time 900
php_value post_max_size 256M
php_value upload_max_filesize 256M
				
			

Step 3 – Save the file.

If both of those methods failed, contact your web hosting provider for assistance.

Share This

Please Donate

If my how-to tutorials helped you, please consider making a donation. ☕ ☕

chkserv

Need affordable cPanel hosting?

Leave a Reply

Your email address will not be published. Required fields are marked *