php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20753 php.ini not read
Submitted: 2002-12-01 18:53 UTC Modified: 2002-12-02 10:14 UTC
From: bill at softky dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.2.3 OS: WinXP
Private report: No CVE-ID: None
 [2002-12-01 18:53 UTC] bill at softky dot com
This is nearly identical to bug #20540, except I've got today's PHP version (and I'm someone else!). I've got php on apache working, phpinfo() says the configuration file path is c:\winnt (although everything else on this system is in c:\windows, and I had to create c:\winnt just to try and satisfy php).

But the php.ini in c:\winnt still isn't being read, as judged by a couple changes ("allow_call_time_pass_referece" and "url_fopen" which I've set to non-default values).  Yes, I'm restarting Apache; yes, I'm force-refreshing my browser; yes, I've verified there are no other php.ini files on the machine.  I've even tried inserting syntax errors into php.ini, and moving it to the system32 directory or the c:\windows directory... no luck.  I can't make that file have any effect at all.

I've built and installed php a zillion times on Linux, and never had this problem.  And I *hate* Windows.  But I have to make this work to be able to use the gd extensions and image functions, and I'm pretty sure this bug is NOT "bogus," since two of us are independently reporting the same thing in the same week. Any suggestions?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-01 19:49 UTC] sniper@php.net
This is most likely another support question, but let's try help you anyway: What is said by phpinfo() for where it's trying to read php.ini from?


 [2002-12-01 21:55 UTC] bill at softky dot com
I assume you mean what phpinfo() prints out in the table at the top (I've clipped it here):
System Windows NT 5.1 build 2600 
Build Date Sep 6 2002 10:38:51 
Server API Apache 
Virtual Directory Support enabled 
Configuration File (php.ini) Path c:\winnt 
Debug Build no 
Thread Safety enabled 

I'd be happy to try changing c:\winnt to some other directory, but I have no idea how to, or where that is configured.
 [2002-12-01 22:07 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-12-01 23:12 UTC] bill at softky dot com
OK, finally got it working: here's the top of phpinfo():
PHP Version 4.4.0-dev 

System  Windows NT localhost 5.1 build 2600  
Build Date  Dec 2 2002 04:12:18  
Server API  Apache  
Virtual Directory Support  enabled  
Configuration File (php.ini) Path  C:\WINDOWS  
PHP API  20020918  

Right below, it shows:
Directive Local Value Master Value 
allow_call_time_pass_reference On On 
allow_url_fopen On On 

The file c:\windows\php.ini still has these entries:

allow_call_time_pass_reference = Off
allow_url_fopen = Off

So it looks like even the CVS snapshot is ignoring the php.ini file it expects to see.  Glad it doesn't want c:\winnt any more; that's an improvement. But the "bug" (or "support issue") remains...
 [2002-12-02 09:51 UTC] bill at softky dot com
This *is* bug (for MS), but also a "support issue" (for PHP).  Turns out that WinXP refuses to display the final ".ini" extension, even in the "properties" display, the file-rename box, or the details list; my file had actually been named "php.ini.ini", and all I could ever see at all in any GUI was "php.ini" (except when I finally used the command line prompt).  Sorry for taking your time, but this is an extremely subtle problem: perhaps the documentation could mention that the renaming and name-checking must happen in the command prompt ("DOS"), because otherwise there will be no error that the file wasn't found.

Take care!
 [2002-12-02 10:14 UTC] philip@php.net
Also it's worth noting that phpinfo() will say:

// Is working
c:\foo\php.ini

As opposed to:

// Is not working
c:\foo\

In otherwords, the name of php.ini will be seen too, not just the path.

Also, please look in your windows options to see if known extensions are being hidden.  When looking at the list of files there should be an option in:

Tools -> Folder Options -> View ->

"Hide file extensions with known types" [ ]

I believe this defaults to on.  Not sure about WinXP but this has existed in other versions.  Anyway, php.ini.ini would show as php.ini in this case.  Also, this may have been the reason why you added the second .ini.  Please confirm and for the love that is sane turn that silly feature off :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 14:01:30 2024 UTC