Re: changing the ini from a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Lucas wrote:
Wolf wrote:
I'm using .htaccess to do
php_value auto_prepend_file "auth.php"

The problem is that there are very specific files that I want to be able to NOT run that in. I guess I could just move them to a directory and use .htaccess to perform a php_value auto_prepend_file ""

But I was hoping to not have to make a separate folder for that. Anyone encoutered being able to change/disable the setting on the fly in a specific file?

Thanks!

Wolf


Just had an interesting way of solving this problem come to mind.

I would like others to way in on this.

You can do this completely from within apache.

For the pages that you want to have auth.php included with, give them and extension of .phtml or something else...

Then, configure apache to allow php to process those like this

AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

then in apache, could be in httpd.conf or .htaccess have something like this.


<Files .phtml>
    php_value auto_prepend_file "auth.php"
</Files>

When finished, restart apache and you should be good to go.

I would try something like this. Should work, others might have better ideas.

Now that I am looking at this a second time. Couldn't all this apache stuff be done in the .htaccess file?

Just place all the following in a .htaccess file, then change the extension on the file(s) that you want to have work this way. I don't think you need to touch the httpd.conf file at all.


AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

<Files .phtml>
    php_value auto_prepend_file "auth.php"
</Files>


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux