Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have manually configured PHP in the past without any problems. Now I'm trying to set up a dev environment with PHP 5.3.1 on Windows 7 x64, and it won't load the php.ini file!

I'm new to both Win7 and the 64bit OS, so it could be something there that I'm missing. Oh...and this is also running in a VM (VMWare Player), though I'm not sure how that might make any difference.

I've set the PHPRC environment variable to point to "c:\php\", set the IniFilePath registry key (in both HKLM/Software/PHP and HKLM/Software/Wow6432Node/PHP) to "c:\php", and I've even copied php.ini to c:\windows, and "php -info" still shows:

Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => (none)

I've even gone as far as setting read access for "Everyone" for c:\Windows\php.ini to no avail.

Can anyone help me figure this out? Thanks in advance! Here's the first bit of output from "php -info"...

phpinfo()
PHP Version => 5.3.1

System => Windows NT DEV 6.1 build 7600 ((null)) i586
Build Date => Nov 19 2009 09:48:59
Compiler => MSVC9 (Visual C++ 2008)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--
enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--with-p
do-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\ora
cle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient
11\sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/"
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => (none)
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20090626
PHP Extension => 20090626
Zend Extension => 220090626
Zend Extension Build => API220090626,NTS,VC9
PHP Extension Build => API20090626,NTS,VC9
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib,
phar
Registered Stream Socket Transports => tcp, udp
Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, stri
ng.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*
share|improve this question
add comment

3 Answers

Under Windows 7 it's a bad idea to put configuration files under c:\windows

Better put PHP.INI in PHP installation directory and follow the guidelines (such as http://www.iis-aid.com/articles/how_to_guides/where_php_ini_is_loaded_from) to tell PHP.EXE where to find PHP.INI

share|improve this answer
    
I understand that. From my question: "I've set the PHPRC environment variable to point to 'c:\php\', set the IniFilePath registry key (in both HKLM/Software/PHP and HKLM/Software/Wow6432Node/PHP) to 'c:\php'..." The problem is that it's NOT getting loaded from c:\php. –  user32782 Jan 25 '10 at 15:37
add comment
up vote 0 down vote accepted

After much trial and error I finally figured out a couple of things:

  1. The main reason it wasn't loading was that I had screwed up the handler mapping request restriction, and inadvertently set the handler to invoke only if the request was mapped to a folder. This was preventing PHP from executing at all in response to an HTTP request. Now that I've fixed that, phpinfo() returns that it's loading php.ini from the c:\php folder.

  2. I still don't know why running "php.exe -info" from the command line shows "Loaded Configuration File => (none)". I've tried everything I could think of to load the correct INI file, and nothing ever worked.

share|improve this answer
add comment

I found Loaded Configuration File is display (none) caluse it's permissions not allow users to access it...

Try to change it's permissions...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.