View Single Post

  #8 (permalink)  
Old 05-10-2008
Sir Robin
 
Posts: n/a
Default Re: Prevent setting of PHP_AUTH_PW?

On Fri, 9 May 2008 09:06:03 -0700 (PDT), Mark Reed <markjreed@gmail.com>
wrote:

>I'd settle for a way to insert a script that unsets it before any
>other PHP is run. I don't suppose there's any way to insert a PHP
>script that gets executed ahead of any other PHP code on the site?


There is a way to insert a PHP script that runs before other PHP code, but as
another poster already pointed out, this could be bypassed easily...

Now I wont guarantee that there is no other ways to bypass it but the only way
I know is through .htaccess file and that can be prevented via configuring
apache (and at this point I realize that my knowledge is about apache+php, I
dont know about other web servers) to not allow setting PHP configuration
options in .htaccess file...

Anyway the way to achieve what you are asking for is to add line like this
into your php.ini file:
auto_prepend_file = "/var/www/html/header.php"

--
***/--- Sir Robin (aka Jani Saksa) Bi-Sex and proud of it! ---\***
**/ email: robsku@fiveam.NO-SPAM.org, <*> Reg. Linux user #290577 \**
*| Me, Drugs, DooM, Photos, Writings... http://soul.fiveam.org/robsku |*
**\--- GSM/SMS: +358 44 927 3992 ---/**
"Sir Robin valehtelee järjestelmällisesti" - Nikolas Mäki
Reply With Quote