PHP will not read php.ini

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
skeath
Forum Newbie
Posts: 3
Joined: Wed Feb 28, 2007 9:48 am

PHP will not read php.ini

Post by skeath »

I have compiled PHP dozens of times, but never seen this.

Fedora core 6
Apache 2 (rpm)
PHP 5.2.1 (compiled from source)

I defined --with-config-file-path=/usr/local/lib

After install, moved a config file to that directory, named it php.ini, stopped and started Apache. Scripts run, but phpinfo()
reports php.ini not found, and displays only default settings.

I have changed ownership and permissions on php.ini, and recompiled with different configure parameters, but nothing works.

Has anyone seen this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Is the PHPIniDir directive set in your httpd.conf?
skeath
Forum Newbie
Posts: 3
Joined: Wed Feb 28, 2007 9:48 am

PHPIniDir

Post by skeath »

No. Is that new to Apache 2?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

When run as a module (maybe as a CGI too) under Apache 2, PHP has a directive called PHPIniDir. New for Apache 2 (over Apache 1.3,) but it's been in PHP for quite some time.
skeath
Forum Newbie
Posts: 3
Joined: Wed Feb 28, 2007 9:48 am

PHPIniDir

Post by skeath »

Thanks very much. I have been using Apache 1.3 before, but had to replicate a development environment that has Apache 2.

However, that change doesn't affect scripts run from the command line. It appears you can pass the path/php.ini to CLI with the -c switch, but
you cannot call the script directly using a shebang line. I always thought that was a cleaner way to call scripts from a cron.

Thanks.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Maybe it's not looking for /usr/local/lib/php.ini but actually looking for /usr/local/lib/php/php.ini ?
Post Reply