FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php.ini loading
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php.ini loading [message #184624 is a reply to message #184623] Mon, 13 January 2014 03:41 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 1/12/2014 10:25 PM, Scott Johnson wrote:
> I am running PHP as an Apache Module.
>
> PHP 5.2.6
>
> On my local server it is loading the php.ini from C:\Windows\php.ini
>
> I am having 2 issues that I can hope to resolve.
>
> 1. I would prefer it to load from the working directory which getcwd()
> shows to be my site root (as expected). This was never a problem before
> but I need to have some independent configs since my clients are across
> different servers.
>
> The config text says it will look for it in the working directory which
> I think brings me to issue 2.
>

Hi, Scotty,

You do NOT want to have your php.ini file ANYWHERE under a
DOCUMENT_ROOT. That is a huge security exposure.

And what's wrong with where it is? PHP will use the same php.ini file
for all invocations if you're running it as an Apache module. You won't
get different ones for different websites.

> 2. The php.ini only reloads when I restart the apache server not on
> each page call which I think is why it is loading the default.
>

That is correct operation. Parsing it for every page would be
unnecessary overhead.

> When I changed the config on the production server it would reflect it,
> but not on the local.
>

Are you running PHP as an Apache module on the production server?


> So in a nut shell I would like to have the config file loaded from my
> working directory on each invocation of a php page.
>
> Is this possible or am I looking at this all wrong?
>
> Thanks
> Scotty
>
>

It is not possible (and not advisable).

But you can put additional PHP options in your Apache configuration file
(and .htaccess if it Apache is configured to use it). You can't change
some things (like which external modules are loaded), but you can most
options. See http://www.php.net/manual/en/ini.list.php for more
information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Trouble connecting to a PHP SoapServer module
Next Topic: switch says value is equal to case when it is not
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 06:15:16 GMT 2024

Total time taken to generate the page: 0.05980 seconds