質問

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.

役に立ちましたか?

解決

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>

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top