1. Knowledge Base
  2. >
  3. Results
  4. >
  5. How to Get Your php.ini Path with SuPHP

How to Get Your php.ini Path with SuPHP

You can specify which php.ini file is used within a certain directory if you have multiple php.ini files.

To do this, edit your .htaccess file located in the directory you wish to use and add the following .htaccess code:

The code below uses "/home/username/www/folder/php.ini" as the location of the php.ini file. Be sure to replace this with the correct path to your preferred php.ini file.
<IfModule mod_suphp.c>
# Loads the module mod_suphp.c
suPHP_ConfigPath /home/username/www/folder
# Specifies the path of the php.ini file. Use your legitimate path.
<Files php.ini>
# Specifies the file php.ini
order allow,deny
# This is ordering to check the allowed list first then the deny list.
deny from all
# Denies everyone from viewing the file specified above
# Closes the files tag
# Closes the modular line 

Save your .htaccess file and enjoy!

If you do not use this option, PHP will use the server's default php.ini path.