[PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Good afternoon, all -

I've had problems with auto_prepend_file off and on for as long as I can
remember.  It's hit or miss, and browsing the archives, it looks like
I'm not alone.  I've even written to the list on several occasions
looking for a solution, to no avail.

I think that auto_{prepend,append}_file are incredibly useful functions,
but they're crap if they don't work.

Here's the basic setup.  From within Apache's config file, here's my
whole VirtualHost container:

VirtualHost 192.168.1.51
DocumentRoot /var/www/virtual
ServerName 192.168.1.51
ErrorLog logs/192.168.1.51-error_log
CustomLog logs/192.168.1.51-access_log combined


#begin dan's protected
directory stuff
Directory /demo/protected
php_value auto_prepend_file /absolute/path/to/file.php
/Directory








   /VirtualHost


So, as you can see, nothing completely out of the 'norm.  The examples
given in the manual are not all that clear, so by using absolute path
names, I'm just guessing.  I have used relative paths as well - same thing.

The auto_prepend_file directive set from within php.ini, is commented
out, as to not overwrite my specification.  I've tried leaving that
directive blank, and setting it to something completely different.  Same
results.

If you guys wouldn't mind taking a few more minutes to mow over all of
this, I would *greatly* appreciate it.

Thanks
-dant

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Dan Trainor wrote:
 Good afternoon, all -
 
 I've had problems with auto_prepend_file off and on for as long as I can
 remember.  It's hit or miss, and browsing the archives, it looks like
 I'm not alone.  I've even written to the list on several occasions
 looking for a solution, to no avail.
 
 I think that auto_{prepend,append}_file are incredibly useful functions,
 but they're crap if they don't work.
 
 Here's the basic setup.  From within Apache's config file, here's my
 whole VirtualHost container:
 
 VirtualHost 192.168.1.51
 DocumentRoot /var/www/virtual
 ServerName 192.168.1.51
 ErrorLog logs/192.168.1.51-error_log
 CustomLog logs/192.168.1.51-access_log combined
 
 
   #begin dan's protected
 directory stuff
 Directory /demo/protected
 php_value auto_prepend_file /absolute/path/to/file.php
 /Directory
 
 
 
 
 
 
 
 
/VirtualHost
 
 
 So, as you can see, nothing completely out of the 'norm.  The examples
 given in the manual are not all that clear, so by using absolute path
 names, I'm just guessing.  I have used relative paths as well - same thing.
 
 The auto_prepend_file directive set from within php.ini, is commented
 out, as to not overwrite my specification.  I've tried leaving that
 directive blank, and setting it to something completely different.  Same
 results.
 
 If you guys wouldn't mind taking a few more minutes to mow over all of
 this, I would *greatly* appreciate it.
 
 Thanks
 -dant
 

Wow, that example came out really badly.  Let's try again:

VirtualHost 192.168.1.51
DocumentRoot /var/www/virtual
ServerName 192.168.1.51
ErrorLog logs/192.168.1.51-error_log
CustomLog logs/192.168.1.51-access_log combined
# begin dan's protected directory stuff
Directory /demo/protected
php_value auto_prepend_file /absolute/path/to/file.php
/Directory
/VirtualHost

Thanks
-dant

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Jasper Bryant-Greene
On Tue, 2005-11-08 at 13:36 -0700, Dan Trainor wrote:
[snip]
  So, as you can see, nothing completely out of the 'norm.  The examples
  given in the manual are not all that clear, so by using absolute path
  names, I'm just guessing.  I have used relative paths as well - same thing.
  
  The auto_prepend_file directive set from within php.ini, is commented
  out, as to not overwrite my specification.  I've tried leaving that
  directive blank, and setting it to something completely different.  Same
  results.
  
  If you guys wouldn't mind taking a few more minutes to mow over all of
  this, I would *greatly* appreciate it.

Would you mind telling us what the problem is? You've said that you are
having problems and that you don't think you're alone, but you haven't
mentioned what the actual problem is.

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
b: http://jbg.name/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Jasper Bryant-Greene wrote:
 On Tue, 2005-11-08 at 13:36 -0700, Dan Trainor wrote:
 [snip]
 
So, as you can see, nothing completely out of the 'norm.  The examples
given in the manual are not all that clear, so by using absolute path
names, I'm just guessing.  I have used relative paths as well - same thing.

The auto_prepend_file directive set from within php.ini, is commented
out, as to not overwrite my specification.  I've tried leaving that
directive blank, and setting it to something completely different.  Same
results.

If you guys wouldn't mind taking a few more minutes to mow over all of
this, I would *greatly* appreciate it.
 
 
 Would you mind telling us what the problem is? You've said that you are
 having problems and that you don't think you're alone, but you haven't
 mentioned what the actual problem is.
 

Ah, oops.

Well, the problem is simple;  it just doesn't work.  No script is
prepended to the page that I access from within /demo/protected.  My
prepend script consists of the following line of code:

? echo This is prepended.br /br /; ?

Sorry about that.

Thanks
-dant

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Jasper Bryant-Greene
On Tue, 2005-11-08 at 13:43 -0700, Dan Trainor wrote:
 Well, the problem is simple;  it just doesn't work.  No script is
 prepended to the page that I access from within /demo/protected.  My
 prepend script consists of the following line of code:
 
 ? echo This is prepended.br /br /; ?
 
 Sorry about that.

Thanks. Have you tried putting quotes around the auto_prepend_file value
in .htaccess? I'm thinking maybe Apache is messing with the path
somehow. Something like:

php_value auto_prepend_file /absolute/path/to/file.php

Oh, and you probably know this, but make sure AllowOverride is set
correctly in your main Apache config file; try setting it to All for
debugging this.

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
b: http://jbg.name/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Jasper Bryant-Greene wrote:
 On Tue, 2005-11-08 at 13:43 -0700, Dan Trainor wrote:
 
Well, the problem is simple;  it just doesn't work.  No script is
prepended to the page that I access from within /demo/protected.  My
prepend script consists of the following line of code:

? echo This is prepended.br /br /; ?

Sorry about that.
 
 
 Thanks. Have you tried putting quotes around the auto_prepend_file value
 in .htaccess? I'm thinking maybe Apache is messing with the path
 somehow. Something like:
 
 php_value auto_prepend_file /absolute/path/to/file.php
 
 Oh, and you probably know this, but make sure AllowOverride is set
 correctly in your main Apache config file; try setting it to All for
 debugging this.
 

Thanks for the help -

I have tried putting quotes around the string, as well, and that yields
the same results.  AllowOverride is set to All.

Thanks again
-dant

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Curt Zirzow
On Tue, Nov 08, 2005 at 01:36:24PM -0700, Dan Trainor wrote:
 Dan Trainor wrote:
  Good afternoon, all -
  
  I've had problems with auto_prepend_file off and on for as long as I can
  remember.  It's hit or miss, and browsing the archives, it looks like
  I'm not alone.  I've even written to the list on several occasions
  looking for a solution, to no avail.
  
  I think that auto_{prepend,append}_file are incredibly useful functions,
  but they're crap if they don't work.
 ...
 
 VirtualHost 192.168.1.51
 DocumentRoot /var/www/virtual
 ...
 # begin dan's protected directory stuff
 Directory /demo/protected
 php_value auto_prepend_file /absolute/path/to/file.php
 /Directory
 /VirtualHost

I believe you want to use Location instead. The Directory path is
never going to be seen since your files are over in /var, and your
prepend is waiting for something in /demo

Curt.
-- 

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Curt Zirzow wrote:
 On Tue, Nov 08, 2005 at 01:36:24PM -0700, Dan Trainor wrote:
 
Dan Trainor wrote:

Good afternoon, all -

I've had problems with auto_prepend_file off and on for as long as I can
remember.  It's hit or miss, and browsing the archives, it looks like
I'm not alone.  I've even written to the list on several occasions
looking for a solution, to no avail.

I think that auto_{prepend,append}_file are incredibly useful functions,
but they're crap if they don't work.

...

VirtualHost 192.168.1.51
DocumentRoot /var/www/virtual
...
# begin dan's protected directory stuff
Directory /demo/protected
php_value auto_prepend_file /absolute/path/to/file.php
/Directory
/VirtualHost
 
 
 I believe you want to use Location instead. The Directory path is
 never going to be seen since your files are over in /var, and your
 prepend is waiting for something in /demo
 
 Curt.

Hello, Curt -

So a Directory container's specification is never relative to the
DocumentRoot?  It's my understanding that it is.

Thanks
-dant

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



Re: [PHP] Use of auto_prepend_file inside an Apache directory container

2005-11-08 Thread Dan Trainor
Dan Trainor wrote:
 Curt Zirzow wrote:
 
On Tue, Nov 08, 2005 at 01:36:24PM -0700, Dan Trainor wrote:


Dan Trainor wrote:


Good afternoon, all -

I've had problems with auto_prepend_file off and on for as long as I can
remember.  It's hit or miss, and browsing the archives, it looks like
I'm not alone.  I've even written to the list on several occasions
looking for a solution, to no avail.

I think that auto_{prepend,append}_file are incredibly useful functions,
but they're crap if they don't work.

...

VirtualHost 192.168.1.51
   DocumentRoot /var/www/virtual
...
   # begin dan's protected directory stuff
   Directory /demo/protected
   php_value auto_prepend_file /absolute/path/to/file.php
   /Directory
/VirtualHost


I believe you want to use Location instead. The Directory path is
never going to be seen since your files are over in /var, and your
prepend is waiting for something in /demo

Curt.
 
 
 Hello, Curt -
 
 So a Directory container's specification is never relative to the
 DocumentRoot?  It's my understanding that it is.
 
 Thanks
 -dant
 

...however, I did heed your advice, and it seemed to work well.  Now I'm
a but confused, unfortunately; why would this not work in a Directory
container?  I thought that I had used this method in the past, with
great success.

Thanks
-dant

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