which script determines which php.ini is included when PHPIniDir is unset? //using apache2
So the internet exhaustively tells anyone who's interested, how to include the PHPIniDir-Directive in the apache-conf to change which php.ini is included on startup.
But I failed trying to just figure out where the ini is set/included in the first place, because that definitely shouldn't be said http.conf, since there is only a general include-php directive there as it stands and my ini is included all right. Sorry for the stupid question, by the way. |
Have a look at section titled 3 Custom php.ini For Each Web Site and let us know!
Have a read of /etc/apache2/mods-enabled/php5.conf Don't change a damn thing in it. :D |
I actually came up with a very reliable strategy for doing this sort of thing, in my "straight CGI" legacy application, which I shamelessly "borrowed" from http://www.askapache.com/php/custom-...ps-and-tricks/.
The voodoo actually requires three Apache directives to cause a custom-script to be invoked: Code:
# First, specify a custom action for php files. (Individual "<VirtualHost>" entries can override this.) Code:
#!/bin/sh In this way, and no matter what the environment otherwise would have stated, the launch sequence of every PHP script in the application is placed under my control, including specification of the ini-file that is to be used. |
Well the site you linked is about the same thing, isn't it? It describes the PHPIniDir-Directive, just in the context of Virtual Hosts. What I meant is: I never set this directive and there is none set by default in the httpd.conf, but Apache still knew which php.ini to include and that kind of bothers me.
I have php7 installed by the way, which seems to have kept out of /etc entirely. I've skimmed through anything that would resemble such a config file (find would find no php7.conf though), but found nothing enlightening. Guess I'll have to live with the mystery for now. |
Quote:
I was actually asking out of sheer interest - the standard .ini is working just fine for my current needs, I just wondered how apache knows where to find it since it is not included via the directive in httpd.conf. So Apache must know through something that happened by default while either it or php was configured I guess, and now stores the information in some mystical place not for me to see. |
As Habitual said, have a look in /etc/apache2/mods-enabled.
From my Debian box: Code:
/etc/apache2$ ls -l mods-enabled/php* |
Quote:
Code:
; See the PHP docs for more specific information. http://php.net/configuration.file Distro specific docs in /usr/share/doc/php5-common/ |
All times are GMT -5. The time now is 07:55 AM. |