php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #20835 Why can't I keep php.ini in PHP's directory?
Submitted: 2002-12-05 13:34 UTC Modified: 2005-08-11 19:42 UTC
From: php-xx-nospam at BrazilianTranslation dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.2 OS: Windows 95/ME
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php-xx-nospam at BrazilianTranslation dot net
New email:
PHP Version: OS:

 

 [2002-12-05 13:34 UTC] php-xx-nospam at BrazilianTranslation dot net
	Hi,
	I used a Win 95 as test environment for a long time, always successfully. Now I'm using a Win ME machine, and have problems. I hate Win ME, but this is someone else's machine so I have to accept this fate for now. I just moved my entire PHP laboratory to this machine and, when I try to run my scripts, I get this error:
------------------------ 8< ------------------------
Security Alert! The PHP CGI cannot be accessed directly. 
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for CGI security.
(been there)

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.
(been there, got the T-shirt)
------------------------ >8 ------------------------

	I am not using Apache, I'm using Omni HTTPD. It worked just fine in my Win 95. I thought that setting cgi.force_redirect to 0 in php.ini would do the trick, but it doesn't.
	
	Well, after a lot of struggle, I tried another thing: move my php.ini file from PHP's directory to the C:\Windows directory. It works! Why?
	I want to say that I find it very annoying. I remember once I had a similar problem, I gave up and moved the php.ini file from PHP's directory to C:\Windows, but then later I moved the php.ini file back to PHP's directory and it worked fine (?). I don't see why it refused to work now. I found a previous bug report in which you suggest setting the environment variable PHPRC to the desired directory. Setting environment variables in Windows ME is such a pain! But it works. But it is not intuitive at all. Not until I saw that previous bug report was I able to look for "PHPRC" in the manual and find mention of this possibility. I find it very convenient being able to leave my ini file in PHP's directory and take the whole directory with me wherever I see fit. I wish you would consider, in the future, changing this behavior, determined at compile time, so that it looks for php.ini in PHP's directory first. Then, if it's not found, in the Windows directory. It sounds a lot more intuitive to me.

        Also, remember that I had php.ini in PHP's directory for a long time in another machine with no knowledge of the PHPRC env var at all. Considering I've seen it work and fail and not been able to identify any pattern that would explain why it works now and fails then, I'd like someone to tell me whether it is a bug, by design and/or if it surprises you knowing that I have been able to actually keep the php.ini file in PHP's directory and get away with it in another machine.
	
	Thanks,
        Luciano ES
        Santos, SP - Brasil

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-11 19:42 UTC] nlopess@php.net
The installation process is now fully (I hope) explained. And yes, you can keep the php.ini file in the PHP's dir.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 21:01:32 2024 UTC