php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #39762 PHPIniDir without php.ini make phpinfo() weird
Submitted: 2006-12-07 01:28 UTC Modified: 2007-08-17 11:28 UTC
From: ceo at l-i-e dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
 [2006-12-07 01:28 UTC] ceo at l-i-e dot com
Description:
------------
I'm a step-by-step kind of guy, so I double-check things as I go.

After installing Apache 2.2 and PHP 5.2.0, I checked my phpinfo()

Despite a PHPIniDir setting of "C:/php" it claimed that php.ini was being "found" in "C:\WINDOWS"

In reality, it wasn't finding php.ini at all, as I hadn't created one yet.


Reproduce code:
---------------
Put PHPIniDir into httpd.conf, and have no php.ini file anywhere that PHP can find.


Expected result:
----------------
I expected phpinfo() to tell me "C:\php" was the directory it had TRIED to find php.ini in.

And without php.ini in there, I'd know that I needed to put php.ini in "C:\php"


Actual result:
--------------
phpinfo() is telling me that it is looking in "C:\WINDOWS" for the php.ini file, despite my PHPIniDir setting.

So I spent a lot of time trying to figure out why my PHPIniDir setting was not taking effect.

It *was* taking effect, but PHP's search ended up in C:\Windows in desparation, and phpinfo() output made me believe I hadn't set PHPIniDir, rather than I hadn't copied a php.ini file yet.

I realize this is pretty picuyane, and that php *DOES* search in multiple places for php.ini

But if httpd.conf is specifically configured to search for php.ini with PHPIniDir, I believe phpinfo() output should reflect that setting, even if php.ini isn't there yet.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-01 16:51 UTC] tokian at hotmail dot com
Try putting 
LoadModule php5_module "C:/php/php5apache2_2.dll"
PHPIniDir "C:/php"

in that order

it seems that PHPIniDir has to be set after LoadModule
 [2007-04-01 23:13 UTC] ceo at l-i-e dot com
The PHPIniDir setting was after the LoadModule.

I simply hadn't yet put a php.ini file in the directory I had set as the correct directory.

In other words:

If the user configures Apache to look for php.ini in dir X, and there is no php.ini there, current behaviour seems to be to start looking for it in all the usual locations, and then reporting it's not in Y (the last usual location), rather than reporting that it's not in X.

Perhaps I'm just expecting the wrong thing, but if Apache is configured to look in X, it ought to just look in X, and quit, and say I couldn't find it in X.
[shrug]
 [2007-06-29 10:42 UTC] nexxure dot inc at gmail dot com
if you let the php installer do the editing of the httpd.conf file, it puts in backslashes (\).  It also gets the order of the directives wrong, it puts the phpinidir before the loadmodule.  so, you have to change the order of the directives and change the backslashes to forward slashes (/).

it worked for me.
 [2007-08-17 11:28 UTC] vrana@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC