can't get php to read ini file.

This is a discussion on can't get php to read ini file. within the PHP Language forums, part of the PHP Programming Forums category; My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d PHP/5.0.4 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-18-2006
dylan.boudreau@gmail.com
 
Posts: n/a
Default can't get php to read ini file.

My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
PHP/5.0.4 on Solaris 10.

phpinfo() lists the location of php.ini as /usr/local/apache/conf and
my php.ini file is there but for some reason it does not appear to be
being read by php. I have defined things such as upload_tmp_dir in
that file yet even with restarting apache I am not seeing this
reflected in phpinfo().

I am pretty new to PHP so its entirely possible I am missing somethign
but any help as to why php.ini would not be read would help me a lot.

Thanks,

Dylan

Reply With Quote
  #2 (permalink)  
Old 08-18-2006
bpuzon
 
Posts: n/a
Default Re: can't get php to read ini file.

dylan.boudreau@gmail.com wrote:

I have defined things such as upload_tmp_dir in
> that file yet even with restarting apache I am not seeing this
> reflected in phpinfo().
>
> I am pretty new to PHP so its entirely possible I am missing somethign
> but any help as to why php.ini would not be read would help me a lot.


I'm not sure if one can define new variables in php.ini...
--
Z powazaniem
Bartek Puzon
Reply With Quote
  #3 (permalink)  
Old 08-18-2006
Erwin Moller
 
Posts: n/a
Default Re: can't get php to read ini file.

dylan.boudreau@gmail.com wrote:

> My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
> PHP/5.0.4 on Solaris 10.
>
> phpinfo() lists the location of php.ini as /usr/local/apache/conf and
> my php.ini file is there but for some reason it does not appear to be
> being read by php. I have defined things such as upload_tmp_dir in
> that file yet even with restarting apache I am not seeing this
> reflected in phpinfo().
>
> I am pretty new to PHP so its entirely possible I am missing somethign
> but any help as to why php.ini would not be read would help me a lot.
>
> Thanks,
>
> Dylan


Hi Dylan,

If phpinfo() runs fine it will also tell you the location of php.ini.
I think somewhere in the first block of info.
Are you edditing THAT php.ini file?
This may sound stupid, but I have seen the mistake of edditing a not-used
php.ini a lot of times before.
Always ask phpinfo() which on eit is using. :-)


Regards,
Erwin Moller
Reply With Quote
  #4 (permalink)  
Old 08-18-2006
dylan.boudreau@gmail.com
 
Posts: n/a
Default Re: can't get php to read ini file.

Thanks to both of you....what I mean when I say I defined new variables
in php.ini is not that I added things but rather changed the value of
things that were already but not defined there and the changes do not
show.

f I force a load of php.ini using PHPRC the line at the top of
phpinfo() is /usr/local/apache/conf/php.ini and at that point things
show as they should but other apps (PHPmyAdmin) stop working properly.
Without using PHPRC the line in phpinfo() is just
/usr/local/apache/conf.

>From what I have been able to find looking around the net, if that line

does not end in php.ini then the file is not being read...I just can't
figure out why.

Thanks in advance for any further insight you can provide.

Dylan

Erwin Moller wrote:
> dylan.boudreau@gmail.com wrote:
>
> > My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
> > PHP/5.0.4 on Solaris 10.
> >
> > phpinfo() lists the location of php.ini as /usr/local/apache/conf and
> > my php.ini file is there but for some reason it does not appear to be
> > being read by php. I have defined things such as upload_tmp_dir in
> > that file yet even with restarting apache I am not seeing this
> > reflected in phpinfo().
> >
> > I am pretty new to PHP so its entirely possible I am missing somethign
> > but any help as to why php.ini would not be read would help me a lot.
> >
> > Thanks,
> >
> > Dylan

>
> Hi Dylan,
>
> If phpinfo() runs fine it will also tell you the location of php.ini.
> I think somewhere in the first block of info.
> Are you edditing THAT php.ini file?
> This may sound stupid, but I have seen the mistake of edditing a not-used
> php.ini a lot of times before.
> Always ask phpinfo() which on eit is using. :-)
>
>
> Regards,
> Erwin Moller


Reply With Quote
  #5 (permalink)  
Old 08-18-2006
Erwin Moller
 
Posts: n/a
Default Re: can't get php to read ini file.

dylan.boudreau@gmail.com wrote:

> Thanks to both of you....what I mean when I say I defined new variables
> in php.ini is not that I added things but rather changed the value of
> things that were already but not defined there and the changes do not
> show.


Ok, clear.
We just call that something like 'setting php.ini variables'.

>
> f I force a load of php.ini using PHPRC the line at the top of
> phpinfo() is /usr/local/apache/conf/php.ini and at that point things
> show as they should but other apps (PHPmyAdmin) stop working properly.
> Without using PHPRC the line in phpinfo() is just
> /usr/local/apache/conf.


From what I hear you putted yourself in the php.ini hell by having more
versions around.
Under most circumstances you only have 1 php.ini.
The PHPRC environment variable is just ONE WAY of pointing to a php.ini
file. see www.php.net, chapter 9: runtime configuration for details.

My advise:
1) Make sure you know WHICH php.ini file is used (using PHPRC or whatever
means).
2) Restart apache (graceful) EVERY TIME you made changes to php.ini, so you
are sure the changes in php.ini are loaded in the webserver. (This is not
needed if you run PHP as CGI, but you don't do that I hope because it is
slow)
3) Now fix the php.ini so it does what you want it to do. In your case I
expect that phpmyadmin stopped working because you have the relevant so's
or dll's commented out in your php.ini, and you were using another php.ini
before.

Hope that helps.

Regards,
Erwin Moller

PS: If you don't have a compelling reason to have many php.ini's around, I
advise you to delete/rename them all except the real one.



>
>>From what I have been able to find looking around the net, if that line

> does not end in php.ini then the file is not being read...I just can't
> figure out why.
>
> Thanks in advance for any further insight you can provide.
>
> Dylan
>
> Erwin Moller wrote:
>> dylan.boudreau@gmail.com wrote:
>>
>> > My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
>> > PHP/5.0.4 on Solaris 10.
>> >
>> > phpinfo() lists the location of php.ini as /usr/local/apache/conf and
>> > my php.ini file is there but for some reason it does not appear to be
>> > being read by php. I have defined things such as upload_tmp_dir in
>> > that file yet even with restarting apache I am not seeing this
>> > reflected in phpinfo().
>> >
>> > I am pretty new to PHP so its entirely possible I am missing somethign
>> > but any help as to why php.ini would not be read would help me a lot.
>> >
>> > Thanks,
>> >
>> > Dylan

>>
>> Hi Dylan,
>>
>> If phpinfo() runs fine it will also tell you the location of php.ini.
>> I think somewhere in the first block of info.
>> Are you edditing THAT php.ini file?
>> This may sound stupid, but I have seen the mistake of edditing a not-used
>> php.ini a lot of times before.
>> Always ask phpinfo() which on eit is using. :-)
>>
>>
>> Regards,
>> Erwin Moller


Reply With Quote
  #6 (permalink)  
Old 08-18-2006
dylan.boudreau@gmail.com
 
Posts: n/a
Default Re: can't get php to read ini file.

Thanks to everyone for the help
I only had one php.ini on the system and there are no dlls as its a
Sparc Solaris box. Its also a clean install so this would have been the
only php ever put on it.

I was never able to figure out what php.ini php was using (even with a
find / -name) to locate it so in the end I decided it was better to
start from scratch all around. I purged apache, php, mysql, and
openssl and rebuilt them all from source in the order mysql -> openssl
-> apache -> php and everything worked like a charm this time.

Thanks again to everyone for the advice.

Erwin Moller wrote:
> dylan.boudreau@gmail.com wrote:
>
> > Thanks to both of you....what I mean when I say I defined new variables
> > in php.ini is not that I added things but rather changed the value of
> > things that were already but not defined there and the changes do not
> > show.

>
> Ok, clear.
> We just call that something like 'setting php.ini variables'.
>
> >
> > f I force a load of php.ini using PHPRC the line at the top of
> > phpinfo() is /usr/local/apache/conf/php.ini and at that point things
> > show as they should but other apps (PHPmyAdmin) stop working properly.
> > Without using PHPRC the line in phpinfo() is just
> > /usr/local/apache/conf.

>
> From what I hear you putted yourself in the php.ini hell by having more
> versions around.
> Under most circumstances you only have 1 php.ini.
> The PHPRC environment variable is just ONE WAY of pointing to a php.ini
> file. see www.php.net, chapter 9: runtime configuration for details.
>
> My advise:
> 1) Make sure you know WHICH php.ini file is used (using PHPRC or whatever
> means).
> 2) Restart apache (graceful) EVERY TIME you made changes to php.ini, so you
> are sure the changes in php.ini are loaded in the webserver. (This is not
> needed if you run PHP as CGI, but you don't do that I hope because it is
> slow)
> 3) Now fix the php.ini so it does what you want it to do. In your case I
> expect that phpmyadmin stopped working because you have the relevant so's
> or dll's commented out in your php.ini, and you were using another php.ini
> before.
>
> Hope that helps.
>
> Regards,
> Erwin Moller
>
> PS: If you don't have a compelling reason to have many php.ini's around, I
> advise you to delete/rename them all except the real one.
>
>
>
> >
> >>From what I have been able to find looking around the net, if that line

> > does not end in php.ini then the file is not being read...I just can't
> > figure out why.
> >
> > Thanks in advance for any further insight you can provide.
> >
> > Dylan
> >
> > Erwin Moller wrote:
> >> dylan.boudreau@gmail.com wrote:
> >>
> >> > My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
> >> > PHP/5.0.4 on Solaris 10.
> >> >
> >> > phpinfo() lists the location of php.ini as /usr/local/apache/conf and
> >> > my php.ini file is there but for some reason it does not appear to be
> >> > being read by php. I have defined things such as upload_tmp_dir in
> >> > that file yet even with restarting apache I am not seeing this
> >> > reflected in phpinfo().
> >> >
> >> > I am pretty new to PHP so its entirely possible I am missing somethign
> >> > but any help as to why php.ini would not be read would help me a lot.
> >> >
> >> > Thanks,
> >> >
> >> > Dylan
> >>
> >> Hi Dylan,
> >>
> >> If phpinfo() runs fine it will also tell you the location of php.ini.
> >> I think somewhere in the first block of info.
> >> Are you edditing THAT php.ini file?
> >> This may sound stupid, but I have seen the mistake of edditing a not-used
> >> php.ini a lot of times before.
> >> Always ask phpinfo() which on eit is using. :-)
> >>
> >>
> >> Regards,
> >> Erwin Moller


Reply With Quote
  #7 (permalink)  
Old 09-13-2006
tanuj
 
Posts: n/a
Default Re: can't get php to read ini file.


hello
when we install php on linux,unix and solaris the file name
php.ini does not exist.It is in the form of php.ini.recomended located
in installation directory of php.after installing php copy
php.ini.recomended to /etc/php.ini(and where you want to set)

dylan.boudreau@gmail.com wrote:
> Thanks to everyone for the help
> I only had one php.ini on the system and there are no dlls as its a
> Sparc Solaris box. Its also a clean install so this would have been the
> only php ever put on it.
>
> I was never able to figure out what php.ini php was using (even with a
> find / -name) to locate it so in the end I decided it was better to
> start from scratch all around. I purged apache, php, mysql, and
> openssl and rebuilt them all from source in the order mysql -> openssl
> -> apache -> php and everything worked like a charm this time.
>
> Thanks again to everyone for the advice.
>
> Erwin Moller wrote:
> > dylan.boudreau@gmail.com wrote:
> >
> > > Thanks to both of you....what I mean when I say I defined new variables
> > > in php.ini is not that I added things but rather changed the value of
> > > things that were already but not defined there and the changes do not
> > > show.

> >
> > Ok, clear.
> > We just call that something like 'setting php.ini variables'.
> >
> > >
> > > f I force a load of php.ini using PHPRC the line at the top of
> > > phpinfo() is /usr/local/apache/conf/php.ini and at that point things
> > > show as they should but other apps (PHPmyAdmin) stop working properly.
> > > Without using PHPRC the line in phpinfo() is just
> > > /usr/local/apache/conf.

> >
> > From what I hear you putted yourself in the php.ini hell by having more
> > versions around.
> > Under most circumstances you only have 1 php.ini.
> > The PHPRC environment variable is just ONE WAY of pointing to a php.ini
> > file. see www.php.net, chapter 9: runtime configuration for details.
> >
> > My advise:
> > 1) Make sure you know WHICH php.ini file is used (using PHPRC or whatever
> > means).
> > 2) Restart apache (graceful) EVERY TIME you made changes to php.ini, so you
> > are sure the changes in php.ini are loaded in the webserver. (This is not
> > needed if you run PHP as CGI, but you don't do that I hope because it is
> > slow)
> > 3) Now fix the php.ini so it does what you want it to do. In your case I
> > expect that phpmyadmin stopped working because you have the relevant so's
> > or dll's commented out in your php.ini, and you were using another php.ini
> > before.
> >
> > Hope that helps.
> >
> > Regards,
> > Erwin Moller
> >
> > PS: If you don't have a compelling reason to have many php.ini's around, I
> > advise you to delete/rename them all except the real one.
> >
> >
> >
> > >
> > >>From what I have been able to find looking around the net, if that line
> > > does not end in php.ini then the file is not being read...I just can't
> > > figure out why.
> > >
> > > Thanks in advance for any further insight you can provide.
> > >
> > > Dylan
> > >
> > > Erwin Moller wrote:
> > >> dylan.boudreau@gmail.com wrote:
> > >>
> > >> > My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
> > >> > PHP/5.0.4 on Solaris 10.
> > >> >
> > >> > phpinfo() lists the location of php.ini as /usr/local/apache/conf and
> > >> > my php.ini file is there but for some reason it does not appear to be
> > >> > being read by php. I have defined things such as upload_tmp_dir in
> > >> > that file yet even with restarting apache I am not seeing this
> > >> > reflected in phpinfo().
> > >> >
> > >> > I am pretty new to PHP so its entirely possible I am missing somethign
> > >> > but any help as to why php.ini would not be read would help me a lot.
> > >> >
> > >> > Thanks,
> > >> >
> > >> > Dylan
> > >>
> > >> Hi Dylan,
> > >>
> > >> If phpinfo() runs fine it will also tell you the location of php.ini.
> > >> I think somewhere in the first block of info.
> > >> Are you edditing THAT php.ini file?
> > >> This may sound stupid, but I have seen the mistake of edditing a not-used
> > >> php.ini a lot of times before.
> > >> Always ask phpinfo() which on eit is using. :-)
> > >>
> > >>
> > >> Regards,
> > >> Erwin Moller


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:27 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0