Question:
PHP with IIS. Phpinfo displays PHP.ini to C:\Windows and not C:\PHP5 - why would this occur?
Siu02rk
2007-04-15 03:15:17 UTC
I have installed PHP on my system and copied and altered the default PHP.ini file. I have created the system path and setup the system variable and I have setup IIS to run scripts only and set PHP to run c:\php5\php5isapi.dll. When I run my test script which is in the wwwroot folder named "phptest.php" with the following code :


I get IIS to run the file however it displays that the PHP.ini file is located in C:\Windows and not C:\PHP5. Why is this?
Three answers:
Yevgeny
2007-04-15 18:01:18 UTC
php.ini is searched in these locations (in order):



* SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)



* The PHPRC environment variable. Before PHP 5.2.0 this was checked after the registry key mentioned below.



* As of PHP 5.2.0, the following registry locations are searched in order: HKEY_LOCAL_MACHINE\ SOFTWARE\PHP\ x.y.z\IniFilePath, HKEY_LOCAL_MACHINE\ SOFTWARE\PHP\ x.y\IniFilePath and HKEY_LOCAL_MACHINE\ SOFTWARE\PHP\ x\IniFilePath, where x, y and z mean the PHP major, minor and release versions.



* HKEY_LOCAL_MACHINE\ SOFTWARE\PHP\ IniFilePath (Windows Registry location)



* Current working directory (except CLI)



* The web server's directory (for SAPI modules), or directory of PHP (otherwise in Windows)



* Windows directory (C:\windows or C:\winnt) (for Windows), or --with-config-file-path compile time option



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



I'm wondering if you set the PHPRC variable correctly. Try reading this article on the topic and see if it doesn't help you: http://www.iis-resources.com/modules/AMS/article.php?storyid=615



It looks like right now, you're at this stage:

http://www.iis-resources.com/images/articles/php5/Fig.10.PNG



On page 3, it tells you how to get this result:

http://www.iis-resources.com/images/articles/php5/Fig.14.PNG



Hope this helps. Please let us know if this helps you as I'm sure other people have this problem and would benefit from a working solution.
lory
2016-05-20 07:25:18 UTC
First. If you have a Windows disc, copy explorer.exe to C:\Windows and re-boot (turn off, then on). If that doesn't fix it, log on as an 'Administrator, back up the registry (or create a restore point) and do the following... Press Ctrl + Shift + Esc Then file new task, type regedit Then go to HKEY_LOCAL_MACHINE\Software\Microsoft\Wi... NT\CurrentVersion\Image Execution Options\ In this list there will be a entry explorer.exe right click on it and export it. Then on the right hand side delete the "debugger" key(the "debugger" key is just a file on the right side of the window named "debugger"). Restart. Then run your anti virus/mal/spyware programs.
anonymous
2007-04-15 09:19:21 UTC
I'd suggest you get a php book to help you..


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...