ID:               36125
 Updated by:       [EMAIL PROTECTED]
 Reported By:      hugues at duplexstudio dot com
-Status:           Open
+Status:           Feedback
-Bug Type:         *General Issues
+Bug Type:         CGI related
 Operating System: Fedora Core 3
 PHP Version:      4.4.2
 New Comment:

>I found a way to execute php code with a different 
>php.ini file if .htaccess is enable.

So what's the problem?


Previous Comments:
------------------------------------------------------------------------

[2006-01-22 18:37:40] hugues at duplexstudio dot com

Description:
------------
Force CGI Redirect is compile by default in Linux Apache system for
security reason. I found a way to execute php code with a different
php.ini file if .htaccess is enable.

Reproduce code:
---------------
In apache I have enable cgi-script and .htaccess

Maybe it's in newest version.

In the root folder of my web site I created a .htaccess file with 

AddHandler cgi-script .phtml

In my /myrootfolder/file.phtml I add
#!/usr/bin/php -c /myrootfolder/php.ini

I chmod +x the file.phtml. 

I create /myrootfolder/php.ini and set cgi.force_redirect = 0 and now I
can run the file.phtml file

The php.ini file and file.phtml must be in the same folder to work.

Expected result:
----------------
If this is not a security issue, 

I expect that the php.ini file could be anywhere on the server if the
user could access it.





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


-- 
Edit this bug report at http://bugs.php.net/?id=36125&edit=1

Reply via email to