Skip to main content

PHP.ini file

1) Php.ini file.

  • The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality. The php.ini file is read each time PHP is initialized.in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version.
  • use phpinfo() to check the path to php.ini.
  • The configuration file is well commented and thorough(complete)
  • Keys are case sensitive, keyword values are not.
  • whitespace, and lines beginning with semicolons are ignored.
  • Booleans can be represented by 1/0, Yes/No, On/Off, or True/False.
Here we are explaining the important settings in php.ini which you may need for your PHP Parser:-

short_open_tag = Off
Short open tags look like this: <? ?>. This option must be set to Off if you want to use XML functions.

safe_mode = Off

If this is set to On, you probably compiled PHP with the --enable-safe-mode flag. Safe mode is most relevant to CGI use. 

disable_functions = [function1, function2...]

Php provides the ability to disable selected functions for security reasons.

Filesystem, system, and network functions should probably be the first to go because allowing the capability to write files and alter the system over HTTP is never such a safe idea


max_execution_time = 30

The function set_time_limit() won.t work in safe mode, so this is the main way to make a script time out in safe mode.

error_prepend_string = [""]


With its bookend, error_append_string, this setting allows you to make error messages a different color than other text, or what have you.

file_uploads = [on/off]

Turn on this flag if you will upload files using PHP script.

mysql.default_host = hostname

The default server host to use when connecting to the database server if no other host is specified.

mysql.default_user = username

The default user name to use when connecting to the database server if no other name is specified.

mysql.default_password = password

The default password to use when connecting to the database server if no other password is specified.