Discussion:
[PHP-INSTALL] php.ini not read?
brian
2009-02-11 17:04:20 UTC
Permalink
phpinfo() says: "configuration file path /apps/local/php5/lib"
phpinfo() also says: "loaded configuration file: (none)"

i'm sure this has to be in a faq somewhere... can someone point me at it?
i'd like to get php to read the php.ini in the config file path.

thanks in advance,
b
Paul Reinheimer
2009-02-11 18:54:40 UTC
Permalink
Hi Brian,

this line
configuration file path /apps/local/php5/lib"

Indicates that it is looking for a php.ini in /apps/local/php5/lib/
but the next line indicates that it didn't find one. Try doing a
search on your machine for php.ini, you will likely find ones
like these
/usr/local/src/php-5.2.5/php.ini-recommended
/usr/local/src/php-5.2.5/tmp-php.ini

Copy one to the aformentioned directory, rename it to php.ini,
edit it to your needs, and restart your webserver


best of luck
paul
brian
2009-02-11 19:59:40 UTC
Permalink
Hi Paul, thanks for the reply. I guess I should have said that the php.ini
is indeed in the stated configuration file path.
Post by Paul Reinheimer
Hi Brian,
this line
configuration file path /apps/local/php5/lib"
Indicates that it is looking for a php.ini in /apps/local/php5/lib/
but the next line indicates that it didn't find one. Try doing a
search on your machine for php.ini, you will likely find ones
like these
/usr/local/src/php-5.2.5/php.ini-recommended
/usr/local/src/php-5.2.5/tmp-php.ini
Copy one to the aformentioned directory, rename it to php.ini,
edit it to your needs, and restart your webserver
best of luck
paul
Keith Roberts
2009-02-11 19:13:21 UTC
Permalink
Subject: [PHP-INSTALL] php.ini not read?
phpinfo() says: "configuration file path /apps/local/php5/lib"
phpinfo() also says: "loaded configuration file: (none)"
i'm sure this has to be in a faq somewhere... can someone point me at it?
i'd like to get php to read the php.ini in the config file path.
thanks in advance,
b
Some more info would be helpfull please Brian.

What OS are you running on?

Did you compile PHP yourself, or is it pre-compiled?

Kind Regards,

Keith Roberts

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
brian
2009-02-11 20:01:49 UTC
Permalink
Hi Keith thanks for the response: running on ubuntu. compiled from source
with:

./configure --with-mysql --prefix=/apps/local/php5
--with-apxs2=/apps/local/httpd/bin/apxs
--with-config-file-path=/apps/local/php5/lib
--with-zlib=/usr --with-curl=/apps/local/curl

thanks,
b
Post by Keith Roberts
Subject: [PHP-INSTALL] php.ini not read?
phpinfo() says: "configuration file path /apps/local/php5/lib"
phpinfo() also says: "loaded configuration file: (none)"
i'm sure this has to be in a faq somewhere... can someone point me at it?
i'd like to get php to read the php.ini in the config file path.
thanks in advance,
b
Some more info would be helpfull please Brian.
What OS are you running on?
Did you compile PHP yourself, or is it pre-compiled?
Kind Regards,
Keith Roberts
-----------------------------------------------------------------
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
Paul Reinheimer
2009-02-11 22:17:43 UTC
Permalink
If you're on a box with sufficient dev tools, strace can help.

strace php -v

Will yeild a lot of output, including:
open("/usr/local/bin/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/local/lib/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file
or directory)
open("/usr/local/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/php.ini", O_RDONLY) = 3

to tell you where it is eventually looking for the file. In my case,
as we can see on the last
line, it found it in "/usr/local/lib/php.ini"



paul

Continue reading on narkive:
Loading...