php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43106 php.ini not found
Submitted: 2007-10-25 17:11 UTC Modified: 2009-12-21 15:48 UTC
From: poletto at jeuxvideo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.4 OS: Linux
Private report: No CVE-ID: None
 [2007-10-25 17:11 UTC] poletto at jeuxvideo dot com
Description:
------------
php.ini is not found when specifying an alternate installation PREFIX (/usr/local/php5).
phpinfo() says configuration path is in /usr/local/php5/lib, so i've put a php.ini there (i've tried some differents php.ini).
phpinfo() says it didn't load any php.ini (and the changes to variables  are ignored).
Yes i've restarted apache.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-26 08:06 UTC] jani@php.net
Is that path readable by the user as what Apache runs as?
Check the permissions.
 [2007-10-26 08:23 UTC] poletto at jeuxvideo dot com
Yes

> ls -la /usr/local/php5/lib/
total 60
drwxr-xr-x    3 root     root         4096 Oct 26 10:16 .
drwxr-xr-x    6 root     root         4096 Oct 23 14:27 ..
drwxr-xr-x   13 root     root         4096 Oct 23 14:27 php
-rw-r--r--    1 root     root        48618 Oct 25 18:30 php.ini

> ls -la /usr/local/php5
total 24
drwxr-xr-x    6 root     root         4096 Oct 23 14:27 .
drwxr-xr-x   21 root     root         4096 Oct 23 14:27 ..
drwxr-xr-x    2 root     root         4096 Oct 25 19:05 bin
drwxr-xr-x    3 root     root         4096 Oct 23 14:27 include
drwxr-xr-x    3 root     root         4096 Oct 25 18:33 lib
drwxr-xr-x    3 root     root         4096 Oct 23 14:27 man

(i've checked parent directories too)


I've found a temporary workaround : it seems that php still checks php.ini in /usr/local/lib (which is the path for the default prefix). It works if i put my php.ini there (but it's not there i intend to put it).
I've tried to specify /usr/local/php5/lib for the configuration path or for the directory in which php should look for configuration files : it changes nothing.
 [2007-10-26 10:09 UTC] jani@php.net
You must be doing something wrong or just overlooked something since this works just fine for me:

Configure Command =>  '../../php-5.2/configure'  '--prefix=/opt/php52' 
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /opt/php52/lib
Loaded Configuration File => /opt/php52/lib/php.ini

PHP will use that path mentioned in the phpinfo() output if there's usable php.ini in it. Make sure you're using "clean" sources when you build PHP and before you install it, shutdown apache.
 [2007-10-26 11:54 UTC] poletto at jeuxvideo dot com
Ok, that's strange.
Maybe it's because several php installations have been made over the time on this server..
I don't really have time to look deeper in this, sorry.
Thanks.
 [2007-10-29 14:35 UTC] jani@php.net
Can not reproduce -> bogus. (if you get time to investigate more, email me)
 [2009-12-21 15:00 UTC] poletto at jeuxvideo dot com
Ok, i figured out what happens
It's still present in 5.2.12

This happens when you launch ./configure without a --prefix option and then relaunch ./configure with a --prefix option

The --prefix isn't ignored but the path to look where is php.ini is buggy
 [2009-12-21 15:48 UTC] johannes@php.net
Always run "make clean" when changing the configure options else you run into all sorts of problems.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 23:01:35 2025 UTC