Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-11 Thread Marcus Bointon

On 10 Nov 2005, at 21:36, Richard Lynch wrote:


On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
../../phpscript.php


I should think all those .* should be .+ instead...

I mean, if somebody surfs to this URL:

http://example.com//example.video


There's nothing really wrong with a URL like that, and I used to do  
the same thing until I discovered another fly in this particular  
ointment. Should source URLs like these ever appear in Microsoft  
Outlook, they are likely to get 'corrected', for example a URL that  
goes in as:


http://example.com//example.video

When you click it, you're quite likely to have it go to:

http://example.com/example.video

thus completely missing all your mod_rewrite patterns. This is why we  
love MS so. I've taken up using _ as a pattern separator as a  
workaround.


There's also a very nasty bug in current mod_rewrite (at least in  
Apache 2.0.54) where mod_rewrite url decodes submatches between input  
and output URLs, so for example:


RewriteRule ^(.*) blah.php?x$1

if you feed that a URL that contains a URL encoded value like 'Hello% 
20there', your resulting URL will be: 'blah.php?x=Hello there', which  
is obviously broken.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Richard Lynch
On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
 Hi there, ive been having issues with mod_rewrite and apache2 with PHP
 5.1RC1. I have googled the php bugs and people have been experiencing
 the same issue however the php people cant see to reproduce the bug.
 Its most definately doing it for me, here is a rewrite rule i have
 setup, if i [L] to a php script, it either tries to download the faked
 url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
 What do i do ?

 RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
 ../../phpscript.php

I should think all those .* should be .+ instead...

I mean, if somebody surfs to this URL:

http://example.com//example.video

Do you really want that to hit ../../phpscript.php

This probably will not fix your bug, mind you, but it's probably worth
trying just to see.

I think you could also lose all those ()s in the Regex, as you don't
seem to be doing anything with them.  Or perhaps mod_rewrite collects
them and passes them in to phpscript.php somehow?

You could also consider using:
[^/]* instead of . because, after all, .* does match /, so maybe you
are confusing the Regex so that:
//example.video actually matches your pattern, even though you
really don't want it to.

I haven't used mod_rewrite enough to know what pattern system it uses,
so I could be full of [bleep] here.

If all else fails, consider not using mod_rewrite at all, and having a
ForceType on some convenient directory to change that directory into a
PHP script.

For example, suppose you now have:
~/videos/*.video
with a zillion video files in there for the *

mkdir video_files
mv videos/*.video video_files
rmdir videos
cp phpscript.php videos
echo -e Files videos\nForceType application/x-httpd-php\n/Files
 .htaccess

Now, your videos directory is *REALLY* your phpscript.php, but it
just *looks* like a directory in the URL.

You'd need to change phpscript.php to read the videos (or whatever it
does to them) from /video_files/ instead of where they are now.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Max Belushkin
I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as Geert 
Booster kindly pointed out, has been reported on 
http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html, 
which also has a link to the PHP bug report in the thread. Not sure if this 
is relevant to PHP5, but thought I'd mention that something similar 
exist(ed?) in the 4.4.1 version.

On Thursday 10 November 2005 22:36, Richard Lynch wrote:
 On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
  Hi there, ive been having issues with mod_rewrite and apache2 with PHP
  5.1RC1. I have googled the php bugs and people have been experiencing
  the same issue however the php people cant see to reproduce the bug.
  Its most definately doing it for me, here is a rewrite rule i have
  setup, if i [L] to a php script, it either tries to download the faked
  url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
  What do i do ?
 
  RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
  ../../phpscript.php

 I should think all those .* should be .+ instead...

 I mean, if somebody surfs to this URL:

 http://example.com//example.video

 Do you really want that to hit ../../phpscript.php

 This probably will not fix your bug, mind you, but it's probably worth
 trying just to see.

 I think you could also lose all those ()s in the Regex, as you don't
 seem to be doing anything with them.  Or perhaps mod_rewrite collects
 them and passes them in to phpscript.php somehow?

 You could also consider using:
 [^/]* instead of . because, after all, .* does match /, so maybe you
 are confusing the Regex so that:
 //example.video actually matches your pattern, even though you
 really don't want it to.

 I haven't used mod_rewrite enough to know what pattern system it uses,
 so I could be full of [bleep] here.

 If all else fails, consider not using mod_rewrite at all, and having a
 ForceType on some convenient directory to change that directory into a
 PHP script.

 For example, suppose you now have:
 ~/videos/*.video
 with a zillion video files in there for the *

 mkdir video_files
 mv videos/*.video video_files
 rmdir videos
 cp phpscript.php videos
 echo -e Files videos\nForceType application/x-httpd-php\n/Files

  .htaccess

 Now, your videos directory is *REALLY* your phpscript.php, but it
 just *looks* like a directory in the URL.

 You'd need to change phpscript.php to read the videos (or whatever it
 does to them) from /video_files/ instead of where they are now.

 --
 Like Music?
 http://l-i-e.com/artists.htm

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 8:36 AM, Richard Lynch wrote:


On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:

Hi there, ive been having issues with mod_rewrite and apache2 with PHP
5.1RC1. I have googled the php bugs and people have been experiencing
the same issue however the php people cant see to reproduce the bug.
Its most definately doing it for me, here is a rewrite rule i have
setup, if i [L] to a php script, it either tries to download the faked
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
What do i do ?

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
../../phpscript.php


I should think all those .* should be .+ instead...


Ill try that thanks ! I guess i could also use [A-z] or whatever lol



I mean, if somebody surfs to this URL:

http://example.com//example.video

Do you really want that to hit ../../phpscript.php


No not at all, this file is actually called from a windows media player 
embedded plugin , ie 
/videos/somethingtoaddtogetquery/anotherthingtoaddtogetquery passed to 
the script as ?somequery=$1anotherquery=$2


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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 8:53 AM, Max Belushkin wrote:

I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as  
Geert

Booster kindly pointed out, has been reported on
http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/ 
027038.html,
which also has a link to the PHP bug report in the thread. Not sure if  
this

is relevant to PHP5, but thought I'd mention that something similar
exist(ed?) in the 4.4.1 version.



There is also a bug report which is now closed for my problem !! This  
bug still exists in the latest PHP 5.1 in snaps.php.net. Mind you my  
apache is a fink binary, not bsd ports. There is huge issues compiling  
apache under osx bsd, hence why i had to go with the binary. Mind you  
osx is my dev environment coz its also my laptop,it is not production  
lol, our production machine however is also BSD. To prove it wasnt thee  
rewrite rule, i made it [L] to a standard html file and it was fine, so  
there is something up with it in php obviouslly in the module.


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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Curt Zirzow
On Thu, Nov 10, 2005 at 06:10:50PM +1100, Dan Rossi wrote:
 
 On 10/11/2005, at 4:18 PM, Curt Zirzow wrote:
 
 On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:
 Hi there, ive been having issues with mod_rewrite and apache2 with PHP
 5.1RC1. I have googled the php bugs and people have been experiencing
 the same issue however the php people cant see to reproduce the bug.
 Its most definately doing it for me, here is a rewrite rule i have
 setup, if i [L] to a php script, it either tries to download the faked
 url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
 What do i do ?
 
 RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ 
 ../../phpscript.php
 
 Well this is a really ugly Rewrite, i must say.
 
 Say what you like however it had been working, and for the application 
 it works, i dont think you get what its trying to do but anyway , im 
 faking a url with session id's and ecrypted keys and sending the 
 matches to the get request of that file so its hidden.

Of course i dont get what your trying to do, the rewriterule
doesn't match your description of what you said.

 
 
 One thing to note is well 5.1RC4 has been available in Oct:
   http://downloads.php.net/ilia/
 
 
 Thats not available from the main site downloads. I also forgot to 
 meantion i had downloaded the latest from php snaps and still the same 
 problem, so obviouslly it has been overlooked.
 
From your other discusions it is kind of unclear exactly what
version of apache you are using, as well as are you using perfork,
perchild, worker, etc..

Also You mention fink but then you mention bsd, does  it happen on
both systems?

As far it trying to download the faked url, what exactly is it
trying to download and what are the headers for the request as
well.

The hanging could be a loop of some sort, have you looked at the
output of the rewrite log to see exactly what is going on?

 
Curt
-- 

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Dan Rossi


On 11/11/2005, at 1:21 PM, Curt Zirzow wrote:





Of course i dont get what your trying to do, the rewriterule
doesn't match your description of what you said.


Ok i am vague at most times, i wasnt going to give an exact example as  
it will give away some of the systems secret and not so good when it  
goes into the archive :\







From your other discusions it is kind of unclear exactly what

version of apache you are using, as well as are you using perfork,
perchild, worker, etc..



Its a prefork setup, worker would be nice though :D



Also You mention fink but then you mention bsd, does  it happen on
both systems?


Errm live system is running php 4.4.1 / Apache 1.3  and its ok. Im  
looking at upgrading it to php 5.1 when its out.




As far it trying to download the faked url, what exactly is it
trying to download and what are the headers for the request as
well.

The hanging could be a loop of some sort, have you looked at the
output of the rewrite log to see exactly what is going on?




Where can i find the log for that, i get a heap  of errors like this  
though


[Thu Nov 10 15:26:06 2005] [error] Optional hook test said: GET  
/videos/dir/42288faa3649e8a66b28871ba9d7e77b/457867517/ 
713ced53f69d16f48072c2d13705e91b/95/180/video.stream HTTP/1.0


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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Curt Zirzow
On Fri, Nov 11, 2005 at 01:27:32PM +1100, Dan Rossi wrote:
 
 On 11/11/2005, at 1:21 PM, Curt Zirzow wrote:
 
 
 
 Of course i dont get what your trying to do, the rewriterule
 doesn't match your description of what you said.
 
 Ok i am vague at most times, i wasnt going to give an exact example as  
 it will give away some of the systems secret and not so good when it  
 goes into the archive :\

Could you come up with a simplified example that causes the error,
so it could be tested on other systems. I was able to have
something like:

 RewriteRule ^(.*)/(.*)/$ /index.php?f=$1b=$2 [L]

And accessing /foo/bar/ It worked like a charm with: 
   $_GET['f'] == '/foo' and $_GET['b'] == 'bar'

When I used the ../../index.php it would cause a 400 Bad Request,
i'm not clear on how your are doing your relative paths.

 Also You mention fink but then you mention bsd, does  it happen on
 both systems?
 
 Errm live system is running php 4.4.1 / Apache 1.3  and its ok. Im  
 looking at upgrading it to php 5.1 when its out.

yeah, this makes me wonder if there are issues with the fink binary
you are using. Is the web server going to get upgraded to 2.x as
well?  I know that php has a completely different way to talk with
the 1.x vs 2.x which can complicate the issue a bit.

 The hanging could be a loop of some sort, have you looked at the
 output of the rewrite log to see exactly what is going on?
 
 Where can i find the log for that, i get a heap  of errors like this  
 though

You can set:
  RewriteLog /path/to/writable/file
  RewriteLogLevel 9 #where 9 is the most verbose

 
 [Thu Nov 10 15:26:06 2005] [error] Optional hook test said: GET  
 /videos/dir/42288faa3649e8a66b28871ba9d7e77b/457867517/ 
 713ced53f69d16f48072c2d13705e91b/95/180/video.stream HTTP/1.0

I'm not really sure what this means, it is related to the
./configure options for apache  --enable-optional-hook*, i have no
clue what that does.


Curt.

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



[PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Dan Rossi
Hi there, ive been having issues with mod_rewrite and apache2 with PHP 
5.1RC1. I have googled the php bugs and people have been experiencing 
the same issue however the php people cant see to reproduce the bug. 
Its most definately doing it for me, here is a rewrite rule i have 
setup, if i [L] to a php script, it either tries to download the faked 
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ?? 
What do i do ?


RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ ../../phpscript.php

Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Curt Zirzow
On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:
 Hi there, ive been having issues with mod_rewrite and apache2 with PHP 
 5.1RC1. I have googled the php bugs and people have been experiencing 
 the same issue however the php people cant see to reproduce the bug. 
 Its most definately doing it for me, here is a rewrite rule i have 
 setup, if i [L] to a php script, it either tries to download the faked 
 url file or hangs.  I reverted back to 5.1.0b2 and it works fine ?? 
 What do i do ?
 
 RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ ../../phpscript.php

Well this is a really ugly Rewrite, i must say.

One thing to note is well 5.1RC4 has been available in Oct:
  http://downloads.php.net/ilia/

Curt.
-- 

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-09 Thread Dan Rossi


On 10/11/2005, at 4:18 PM, Curt Zirzow wrote:


On Thu, Nov 10, 2005 at 03:36:07PM +1100, Dan Rossi wrote:

Hi there, ive been having issues with mod_rewrite and apache2 with PHP
5.1RC1. I have googled the php bugs and people have been experiencing
the same issue however the php people cant see to reproduce the bug.
Its most definately doing it for me, here is a rewrite rule i have
setup, if i [L] to a php script, it either tries to download the faked
url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
What do i do ?

RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ 
../../phpscript.php


Well this is a really ugly Rewrite, i must say.


Say what you like however it had been working, and for the application 
it works, i dont think you get what its trying to do but anyway , im 
faking a url with session id's and ecrypted keys and sending the 
matches to the get request of that file so its hidden.




One thing to note is well 5.1RC4 has been available in Oct:
  http://downloads.php.net/ilia/




Thats not available from the main site downloads. I also forgot to 
meantion i had downloaded the latest from php snaps and still the same 
problem, so obviouslly it has been overlooked.



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