Re: php.ini settings not taking effect
From: Andy Hassall (andy_at_andyh.co.uk)
Date: 11/06/04
- Next message: Ed Jones: "Re: How do you make a script run automatically?"
- Previous message: Berislav Lopac: "Re: Best PHP5 Web Hosting?"
- In reply to: Don: "Re: php.ini settings not taking effect"
- Next in thread: Illusionistx: "Re: php.ini settings not taking effect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 06 Nov 2004 12:26:42 +0000
On Fri, 05 Nov 2004 23:30:46 -0700, Don <no@adr.com> wrote:
>On Sat, 06 Nov 2004 02:00:00 +0000, Andy Hassall <andy@andyh.co.uk> wrote:
>
>>On Fri, 05 Nov 2004 05:33:09 -0700, Don <no@adr.com> wrote:
>>
>>>Thanks for your reply. Just did a phpinfo() and got the following:
>>>Apache 1.3.27
>>>Unix
>>>PHP 4.3.4
>>
>> What does phpinfo() say the path it is using is?
>>
>> I tend to have php.ini in the same directory as Apache's httpd.conf, but it's
>>configurable, either with PHPRC or at PHP compile time.
>
>phpinfo():
>Apache 1.3.27
>Unix
>PHP 4.3.4
>Using php.ini at: /usr/local/lib/php.ini
>
>Is that /usr/local/lib/php.ini a directory that I have access to? If so, how do I access it? I
>don't have control over Apache's httpd.conf, as I'm running my php scripts on my ISP server.
That would have been a useful bit of information to post earlier - since you
asked why your changes to php.ini aren't being picked up, it gives the
impression you control the server in the first place...
> I have
>a ticket into them to find out why their PHP apparently isn't looking in my working directory on
>their server (where my php scripts are) for my php.ini.
It shouldn't do. PHP configuration, at least for the Apache module version
(another assumption - running as a module is the most common configuration) is
only read when Apache starts. Even if you could change php.ini at runtime,
which if you're just a user you can't, then it wouldn't make any difference
because PHP doesn't even read it until next startup.
Even that assumption might be inaccurate; you could be running PHP as CGI,
which is slower, but there's then the opportunity to point it at your own
php.ini file through $PHPRC or a command-line switch in the #! line at the top
of the script.
> However, I think I read that one can tell
>PHP the location of the php.ini file to use via the PHPRC environment variable. I at a loss on this
>one. Sure could use some help.
I'm trying to help but you've not given enough information, and the
situation's changed now you've said you're a user on somebody else's server,
rather than setting up your own.
Take a step back - you've been asking how to change php.ini - this is almost
certainly the wrong approach. Your ISP is not going to change something
server-wide just for your benefit, it'll break other people's scripts.
You mentioned in the original post that what you were actually trying to do is
turn off magic_quotes_gpc.
There are several places to alter PHP configuration settings:
(1) Server-wide in php.ini. Only read at startup. Only the administrator can
change it.
(2) At runtime, with ini_set(). Only works for a subset of options.
magic_quotes_gpc is not one of them. See the manual for the list.
(3) In an Apache .htaccess file. Depends on your configuration. You can change
more settings here than you can with ini_set(), but not all of them. You _can_
change magic_quotes_gpc.
And of course, read the manual: http://www.php.net/manual/en/configuration.php
Each of these options is explained there.
-- Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk> <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
- Next message: Ed Jones: "Re: How do you make a script run automatically?"
- Previous message: Berislav Lopac: "Re: Best PHP5 Web Hosting?"
- In reply to: Don: "Re: php.ini settings not taking effect"
- Next in thread: Illusionistx: "Re: php.ini settings not taking effect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|