RNK
RNK

Reputation: 5792

custom php.ini for domain

I have global php.ini file located in /usr/local/lib folder. The custom php.ini file is in /home/petstail/public_html/ folder.

This is how my phpinfo() look like.

enter image description here

I am still loading global php.ini file. How to change configuration file path, and run custom php.ini file.

Thanks.

Upvotes: 0

Views: 3285

Answers (2)

CD001
CD001

Reputation: 8472

You might be able to do it via .htaccess by setting an environment variable (if Apache is running mod_php):

SetEnv PHPRC /home/petstail/public_html/php.ini

However, your php.ini file should not be in the document root (where it's publicly accessible) ... at the very least store it in a directory protected with another .htaccess defining Deny from all.

OR you could deny access to php.ini using the following.

<FilesMatch "php.ini">
    deny from all
    allow from 127.0.0.1
<FilesMatch>

Upvotes: 1

Tommy Logik
Tommy Logik

Reputation: 93

Depending on your php version you should refer the the php documentation to see if INI settings are on.

See here: http://www.php.net/manual/en/configuration.file.per-user.php

Upvotes: 0

Related Questions