Php.ini does not work outside the public_html directory

Just a very quick question about the php.ini file. I created my own mypp.ini file and it works fine if I put it in my public_html directory. However, the problem is that it can be explicitly viewed in the browser through HTTP requests.

So, I'm trying to move it outside my public_html directory, but it doesn't seem to work when it is outside of my public_html.

I know that I could set the following in my .htaccess so as not to read:

<Files php.ini>
  Order allow,deny
  Deny from all
</Files>

However, I do not want to do this, since my php.ini can still be cached by Google if it is in the "public_html" directory. Are there any suggestions to make it work outside of my public_html?

I am running an Apache server. Thanks for any suggestions.

+3
source share
4 answers

Unable to get Google caching if you block it in .htaccess

+2
source

You can use an environment variable PHPRC... see the documentation:

http://www.php.net/manual/en/configuration.file.php

+3
source

:

  • , Apache php.ini(PHPINIDIR/path/where/php.ini/is/located)
  • , -.
+1

- php.ini? ​​.

, , , , , vhost php. , vhost php.ini vhost. . .

0

All Articles