[How To] find php.ini file

[How To] find php.ini file

The location of the php.ini file can vary depending on the server configuration. Here are a few ways to find the location of the php.ini file.

  1. Use the phpinfo() function: Create a new PHP file with the following code and run it on your server:

    			<?php 
    				phpinfo(); 
    			?>
            

    This will display a lot of information about your PHP installation, including the location of the php.ini file.

  2. Use the command line: You can use the following command in the command line/terminal to locate the php.ini file:

    php --ini

    This will display the location of the php.ini file.

  3. Check with your hosting provider: If you are on a shared hosting plan, you may not have access to the php.ini file. In this case, you can contact your hosting provider to find out the location of the file.

  4. Look for default location: If you are running PHP on Windows, the php.ini file is typically located in the Windows directory, such as C:\windows or C:\winnt. On Linux, it is typically located in /etc/ or /usr/local/lib/.

Note: you may have multiple php.ini file on the server, make sure you are editing the correct one.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.