php settings file

PHP is an opensource server scripting language used to create dynamic websites. PHP is used widely in the world and is very renowned scripting language. Multiple version of php is available like php 5.0, php 7.0 etc. PHP has many options that user can configure and sue through php settings file. In this article I will be guiding you to identify the correct file to make settings in case of any php errors. This may vary depends how php, apache etc are installed on server.

View Current PHP Settings:

Create a phpinfo page and upload it to root of your website as stated in this article how to create phpinfo pageRun the phpinfo page in browser, it will display various variables and values like as shown in image below.

php info file

Inorder to update variable values it will depend on how php is setup on server. PHP might be running in either of the two modes.

i) Apache Module

ii) CGI Module

How to Identify if php is running as Apache or CGI Module:

Inorder to identify php is running cgi or apache module, look for the output of phpinfo file on browser and  look at the “Server API”‘ value. If the “Server API” is “CGI”, then PHP is running as “CGI module“. If “Apache” is listed, then your server is running PHP as an “Apache module“.

If your server is running PHP as an “Apache module”, then you can change your PHP settings through .htaccess file. A .htaccess file is a configuration file that you can create and use to override or change server settings, including PHP settings.

You can edit the php settings in .htaccess file as-

php_value max_execution_time 180

If your php server is running as an “CGI module”, then you can change your php settings through custom php.ini which you can upload to root of your site. You can edit the settings as-

max_execution_time = 180
max_input_time = 60

There might be the case when you php.ini changes may not be reflecting in that case you may need to keep the file recursively into multiple folders in your application.

Please follow and like us:
One Comment

Add a Comment

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