|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37887 My php.ini is not read
Submitted: 2006-06-22 13:20 UTC Modified: 2006-06-22 18:54 UTC
From: petrkuzel at eurofins dot com Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 5.1.4 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: petrkuzel at eurofins dot com
New email:
PHP Version: OS:


 [2006-06-22 13:20 UTC] petrkuzel at eurofins dot com
I want to use mssql extension but I'm not able to make PHP use my php.ini file that contains declaration.

5.1.4 is manually installed on Windows with IIS 5.1. 

Reproduce code:

  echo "INI = " . get_cfg_var("cfg_file_path") . "<br>"; 

  echo "Prepend = " . ini_get("auto_prepend_file") . "<br>";



Expected result:
Instead of expected:

  INI = c:\app\php\
  Prepent = c:\app\php\marker.txt

Actual result:

  INI = 
  Prepend = 
  <the info tables> reporting ini path as "c:\windows" (I put there one with 'auto_prepend_file marker' but it's not picked up), extension_dir as "c:\php5", consequently no extensions discovered.... 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-22 14:07 UTC] petrkuzel at eurofins dot com
I tried to set HKEY_LOCAL_MACHINE/SOFTWARE/PHP/IniFilePath in registry, but it's also ignored (based on missing the header mark and phpinfo() output). Still empty result. It's after IIS restart (from IIS console).
 [2006-06-22 14:29 UTC] petrkuzel at eurofins dot com
OK it looks like PHP is written in restart whole OS style. After restarting OS php.ini from C:\windows was picked. I do not undertand why (there is one in php dir and one pointed by Windows registry key) but at least I know where to put my php.ini. In spite of fact I hate it, I can use system global.

Now I can get to point,
 [2006-06-22 14:35 UTC] petrkuzel at eurofins dot com
My partial conclusion. 

If phpinfo() states as used php.ini "c:\windows" it in fact does NOT use any php.ini. 

When is uses php.ini from C:\windows it is reported as "c:\windows\php.ini"

It would be nice if phpinfo() returned what locations were probed for the php.ini.
 [2006-06-22 14:54 UTC] petrkuzel at eurofins dot com
Registry HKEY_LOCAL_MACHINE/SOFTWARE/PHP/IniFilePath works if it points to folder (vs file as suggested by the name :-(). Again restart.

The remaining issue (for me) is what is SAPI default location and web server location in case of IIS.
 [2006-06-22 18:54 UTC]
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 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.

Put your php.ini to c:\windows and restart web-server.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 19:05:54 2022 UTC