Change language

PHP Php.ini file configuration

All parameters related to global variable registration, maximum upload size, displaying log errors, resource limits, maximum PHP script execution time, and others are written to a file as a set of directives that help declare changes. Note. Whenever any changes are made to the file, you need to restart our web server.This helps in simple administration of the web server using these configuration files. We can also write our own configuration files.Use the following program to check the file path: echo phpinfo(); ?> Note. Keys in file are case sensitive, keyword values ​​are not whitespace, and lines starting with semicolons are ignored. The file is well commented. Boolean values ​​are represented by incl. / Off, 1/0, True / False, Yes / No. The file contains a set of directives with a set of corresponding values ​​assigned to it. Values ​​can be a string, a number, a PHP constant, INI constants or an expression, a quoted string, or a reference to a previously set variable. An INI file expression is delimited by bitwise operators or parentheses. Settings with a specific hostname will only work on that specific host.File Environment Variables:
  • memory_limit:this parameter is made to show the maximum amount of memory consumed by the script.
Important settings or general parameters of the php.ini file:
  • enable_safe_mode = onThe default is ON when PHP is compiled. Safe mode is most relevant for using CGI.
  • register_globals = byis enabled by default, which means that the contents of the EGPCS variables (Environment, GET, POST, Cookie, Server) are registered as global variables. But due to the security risk, the user must make sure it is set to OFF for all scripts.
  • upload_max_filesizeThis setting is for the maximum size allowed for uploading files in scripts.
  • upload_tmp_dir = [DIR]Do not uncomment this parameter.
  • post_max_sizeThis parameter is for the maximum size of POST data that PHP will accept.
  • display_errors = offThis option prevents errors from being displayed when running a PHP project on the specified host.
  • error_reporting = E_ALL & amp; ~ E_NOTICE:this parameter has default values ​​such as E_ALL and ~ E_NOTICE, which show all errors except notifications.
  • error_prepend_string = [“”]This this parameter allows you to create messages of different colors.
  • max_execution_time = 30The maximum execution time is set in seconds for any scenario to limit the time on production servers.
  • short_open_tags = OffTo use the XML functions, we must set this option as
  • = filesYou do not need to change anything in this parameter.
  • variable_order = EGPCSThis parameter is used to set the order of variables: Environment, GET, POST, COOKIE, SERVER. The developer can change the order as needed.
  • warn_plus_overloading = OffThis option issues a warning if + is used with strings as a value.
  • gpc_order = GPCThis setting is deprecatedas GPC.
  • magic_quotes_gpc = onother and display the form values.
  • magic_quotes_runtime = OffIf magic_quotes_sybase is set to On, it must be Off, this parameter escapes the quotes.
  • magic_quotes_sybase = OffIf this option is disabled, it should be disabled, this option escapes quotes.
  • auto-prepend-file = [filepath]This option is executed when we you need to automatically include it at the beginning of every PHP file.
  • auto-append-file = [filepath]This option is executed when we need to automatically include it at the end of each PHP file.
  • include_path = [DIR]This option is executed when we need files from the specified directories. Multiple directories are installed using colons.
  • ignore_user_abort = [On / Off]These settings determine what happens when the user clicks any stop button. The default value for this parameter does not work in CGI mode, it only works in module mode.
  • doc_root = [DIR]This parameter is done if we want to apply PHP to a part of our site.
  • file_uploads = [on / off]This flag is set if file uploadis enabled in the PHP code.
  • mysql.default_host = hostnameThis parameter is used to connect to the default MySQL server if no other server is specified.
  • mysql.default_user = usernameThis parameter is used to connect the default MySQL username if no other name is mentioned.
  • mysql.default_password = passwordThis parameter is used to connect the default MySQL password if no other password is specified.
  • Configuring php.ini file:whenever we install PHP, we can find the config file in the PHP folder. When using xampp, we can find the configuration file in one or more versions, inside the pathNote.Other versions of this file are and , file is most preferred.


    Best laptop for Sims 4


    Best laptop for Zoom


    Best laptop for Minecraft


    Best laptop for engineering student


    Best laptop for development


    Best laptop for Cricut Maker


    Best laptop for hacking


    Best laptop for Machine Learning


    Latest questions


    psycopg2: insert multiple rows with one query

    12 answers


    How to convert Nonetype to int or string?

    12 answers


    How to specify multiple return types using type-hints

    12 answers


    Javascript Error: IPython is not defined in JupyterLab

    12 answers


    Python OpenCV | cv2.putText () method

    numpy.arctan2 () in Python

    Python | os.path.realpath () method

    Python OpenCV | () method

    Python OpenCV cv2.cvtColor () method

    Python - Move item to the end of the list

    time.perf_counter () function in Python

    Check if one list is a subset of another in Python

    Python os.path.join () method