|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33882 php.ini search path with CLI api
Submitted: 2005-07-27 14:52 UTC Modified: 2005-07-27 17:10 UTC
From: Assigned:
Status: Closed Package: *Configuration Issues
PHP Version: 5CVS-2005-07-27 (dev) OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
36 - 7 = ?
Subscribe to this entry?

 [2005-07-27 14:52 UTC]
the first place to look for a php.ini is supposed to be 
the directory where the php binary is installed

this is done by taking the dirname out of 
and then appending php.ini

on the other hand sapi_module.executable_location
is just a copy of argv[0] for CLI

so if the CLI is just called as 'php' it looks for php.ini
in "php/php.ini"

a realpath() call should be added somewhere to fix this

Reproduce code:
strace php 2>&1 | grep php.ini

Expected result:
php.ini looked for in /usr/local/bin/php.ini

Actual result:
php.ini looked for in php/php.ini


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-27 17:10 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Dec 07 01:01:28 2023 UTC