short URLs not working with PHP5

View: New views
9 Messages — Rating Filter:   Alert me  

short URLs not working with PHP5

by Ryan Walker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I manage a few sites, all on the same host, where short URLs only work
in PHP 4.  I can change the PHP version in cpanel, and when I change it
to PHP 5.2.6, the short URLs don't work.  That is, the page doesn't
change when I click on the links on my site, even though the URL in the
location window of my browser changes.  If I use the query string URLs,
there's no problem.

When I toggle the PHP version and view the phpinfo() output, I see that
for both PHP 4 and PHP 5, the line for Server API says CGI.  Does that
mean that PHP is being run as a CGI?  If so, I'm not sure why the short
URLs are working in the PHP 4.4.8 scenario.

There is a notice from the web host that says "Along with the PHP 5
upgrade on all servers, we will be switching to suphp instead of
mod_php."  Could that be a factor?

Thanks,
Ryan


--
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Parent Message unknown Re: short URLs not working with PHP5

by jojodee-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ryan Walker wrote:
> Hi all,
  ...
>
> When I toggle the PHP version and view the phpinfo() output, I see that
> for both PHP 4 and PHP 5, the line for Server API says CGI.  Does that
> mean that PHP is being run as a CGI?  If so, I'm not sure why the short
> URLs are working in the PHP 4.4.8 scenario.

PHP is being run as CGI. There was a fix put in so that short urls did
run under CGI for php4.x.x (http://bugs.xaraya.com/show_bug.cgi?id=5071)
but i've not really looked at this problem since then.

> There is a notice from the web host that says "Along with the PHP 5
> upgrade on all servers, we will be switching to suphp instead of
> mod_php."  Could that be a factor?


suphp does require the site to be running under CGI (suphp provides
similar functionality to apache suexec). Therefore there could be
problems if you are running php5 and cgi. There are a few posts around
about cgi/php5 and xaraya short urls and one of those solutions might
work for you. I'll try and take a look but can probably only test on
windows under cgi at the moment.

Cheers
Jo

[Note: you didn't mention what apache you were on. For apache2 you also
need AcceptPathInfo On for short urls in apache config or .htaccess file]



--
http://xarigami.com :: Creative web development with Xaraya
http://2skies.com   :: Open source hosting and development
_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Re: short URLs not working with PHP5

by Ryan Walker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jo,

I tried this...
http://www.xaraya.com/index.php/xarbb/topic/2952#12588
...but it didn't help.

And I'm guessing this...
http://www.xaraya.com/pipermail/xaraya_bugs/2005-October/011728.html
...is not going to work for PHP 5.

The Apache version is 2.2.8.  I'm aware of this...
http://www.xaraya.com/documentation/userguide/apb.html#apache2urls
...but in my case, I find that the short urls work in PHP 4.4.8 + Apache
2.2.8 without the need for AcceptPathInfo On.  And when I add
AcceptPathInfo On to my htaccess, short urls still don't work with a
switch to PHP 5.2.6.

I'm pretty concerned about this, because I've moved five sites to this
host (WireNine) in the last year or so, and it looks like I only have a
week to either get short URLs working on this host or move the sites to
another host.  They say they're dropping PHP 4 in about a week.  They
put out a notice a while ago, but I guess I didn't understand the
implications.  Naturally I don't relish the thought of moving five sites
to a new host, especially when this one works so well in most respects.

I wonder if there's anything else I can try to get short URLs working
with suphp + PHP5?

Doing without the short URLs isn't an option.  I use xarModURL in menus,
so those links won't break, but there are plenty of links in the content
area of pages that will break.  Also, it's just not a feature I'd want
to do without.

Lastly, I wonder if the suphp + PHP 5 is a problem only for Xaraya's
directory-style URLs... or would this be a problem for all content
management systems that provide an option for directory-style URLs?  
Drupal, etc.  Not sure if anyone here can speak to that... but I figure
if this setup is going to doom all directory-style URLs in all content
management systems, then I should tell the host about that.

Thanks!
Ryan





jojodee wrote:

> Ryan Walker wrote:
>  
>> Hi all,
>>    
>   ...
>  
>> When I toggle the PHP version and view the phpinfo() output, I see that
>> for both PHP 4 and PHP 5, the line for Server API says CGI.  Does that
>> mean that PHP is being run as a CGI?  If so, I'm not sure why the short
>> URLs are working in the PHP 4.4.8 scenario.
>>    
>
> PHP is being run as CGI. There was a fix put in so that short urls did
> run under CGI for php4.x.x (http://bugs.xaraya.com/show_bug.cgi?id=5071)
> but i've not really looked at this problem since then.
>
>  
>> There is a notice from the web host that says "Along with the PHP 5
>> upgrade on all servers, we will be switching to suphp instead of
>> mod_php."  Could that be a factor?
>>    
>
>
> suphp does require the site to be running under CGI (suphp provides
> similar functionality to apache suexec). Therefore there could be
> problems if you are running php5 and cgi. There are a few posts around
> about cgi/php5 and xaraya short urls and one of those solutions might
> work for you. I'll try and take a look but can probably only test on
> windows under cgi at the moment.
>
> Cheers
> Jo
>
> [Note: you didn't mention what apache you were on. For apache2 you also
> need AcceptPathInfo On for short urls in apache config or .htaccess file]
>
>
>
>  


--
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Parent Message unknown Re: short URLs not working with PHP5

by Chris-624 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ryan Walker <Ryan@...> wrote in message <mailman.535.1214930021.5375.xaraya_devel@...>

> Hi Jo,
> I tried this...
> http://www.xaraya.com/index.php/xarbb/topic/2952#12588
> ...but it didn't help.
> And I'm guessing this...
> http://www.xaraya.com/pipermail/xaraya_bugs/2005-October/011728.html
> ..is not going to work for PHP 5.
> The Apache version is 2.2.8.  I'm aware of this...
> http://www.xaraya.com/documentation/userguide/apb.html#apache2urls
> ..but in my case, I find that the short urls work in PHP 4.4.8 + Apache
> 2.2.8 without the need for AcceptPathInfo On.  And when I add
> AcceptPathInfo On to my htaccess, short urls still don't work with a
> switch to PHP 5.2.6.
> I'm pretty concerned about this, because I've moved five sites to this
> host (WireNine) in the last year or so, and it looks like I only have a
> week to either get short URLs working on this host or move the sites to
> another host.  They say they're dropping PHP 4 in about a week.  They
> put out a notice a while ago, but I guess I didn't understand the
> implications.  Naturally I don't relish the thought of moving five sites
> to a new host, especially when this one works so well in most respects.
> I wonder if there's anything else I can try to get short URLs working
> with suphp + PHP5?
> Doing without the short URLs isn't an option.  I use xarModURL in menus,
> so those links won't break, but there are plenty of links in the content
> area of pages that will break.  Also, it's just not a feature I'd want
> to do without.
> Lastly, I wonder if the suphp + PHP 5 is a problem only for Xaraya's
> directory-style URLs... or would this be a problem for all content
> management systems that provide an option for directory-style URLs?  
> Drupal, etc.  Not sure if anyone here can speak to that... but I figure
> if this setup is going to doom all directory-style URLs in all content
> management systems, then I should tell the host about that.
> Thanks!
> Ryan
> jojodee wrote:
> > Ryan Walker wrote:
> >  
> >> Hi all,
> >>    
> >   ...
> >  
> >> When I toggle the PHP version and view the phpinfo() output, I see that
> >> for both PHP 4 and PHP 5, the line for Server API says CGI.  Does that
> >> mean that PHP is being run as a CGI?  If so, I'm not sure why the short
> >> URLs are working in the PHP 4.4.8 scenario.
> >>    
> >
> > PHP is being run as CGI. There was a fix put in so that short urls did
> > run under CGI for php4.x.x (http://bugs.xaraya.com/show_bug.cgi?id=5071)
> > but i've not really looked at this problem since then.
> >
> >  
> >> There is a notice from the web host that says "Along with the PHP 5
> >> upgrade on all servers, we will be switching to suphp instead of
> >> mod_php."  Could that be a factor?
> >>    
> >
> >
> > suphp does require the site to be running under CGI (suphp provides
> > similar functionality to apache suexec). Therefore there could be
> > problems if you are running php5 and cgi. There are a few posts around
> > about cgi/php5 and xaraya short urls and one of those solutions might
> > work for you. I'll try and take a look but can probably only test on
> > windows under cgi at the moment.
> >
> > Cheers
> > Jo
> >
> > [Note: you didn't mention what apache you were on. For apache2 you also
> > need AcceptPathInfo On for short urls in apache config or .htaccess file]
> >
> >
> >
> >  
> --
> Ryan Walker
> www.WebCommunicate.net:
> Insights and resources for effective websites.

Hi Ryan,
I just switched hosts, and had very similar problems with ShortURLs. The tried and tested Xaraya method for htaccess mod_rewrite directives refused to work. After a couple of days of trying variations, I came up with the re-write posted here

http://crispcreations.co.uk/myblog/Removing_index.php_from_Xaraya_UR Ls

which worked for me. May fix your prob, may not, but it's got to be worth a go eh?

regards

Chris



_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Re: short URLs not working with PHP5

by Ryan Walker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Chris.  I wasn't clear about this:  I'm not having any trouble
with removing index.php.  It's eliminating the query-string URLs, in
favor of directory-style URLs, that I'm struggling with... with suphp
and PHP 5.2.6.
-Ryan


Chris wrote:

>
> Hi Ryan,
> I just switched hosts, and had very similar problems with ShortURLs. The tried and tested Xaraya method for htaccess mod_rewrite directives refused to work. After a couple of days of trying variations, I came up with the re-write posted here
>
> http://crispcreations.co.uk/myblog/Removing_index.php_from_Xaraya_UR Ls
>
> which worked for me. May fix your prob, may not, but it's got to be worth a go eh?
>
> regards
>
> Chris
>
>
>
> _______________________________________________
> Xaraya_devel mailing list
> Xaraya_devel@...
> http://xaraya.com/mailman/listinfo/xaraya_devel
>
>  


--
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Re: short URLs not working with PHP5

by Ryan Walker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For what it's worth, this what my web host had to say: "PHP4 will be
permanently removed in the near future, as it's no longer being
developed or maintained. suPHP with PHP 5 should not be affecting your
ability to use mod rewrite to modify your script urls."

Can someone tell me if there is something about the design of Xaraya's
short url feature that makes it especially difficult to provide the
feature when PHP is run as a CGI?  Is there something in the design of
Xaraya that makes this inherently difficult?  Or is there some reason
why this capability would come at too great a cost in terms of
performance or some other consideration?  Frankly I don't have much
knowledge of things at this level.  I'm not even sure what the meaning
of "PHP as a CGI" really is.  I'm going to do more searching at
xaraya.com and elsewhere to see if I can get a better understanding of
how the short urls feature works and why it depends on mod_php... but
I'm starting from zero knowledge, so it would be good to know if I'm
headed down a dead end road.

Thanks,
Ryan



Ryan Walker wrote:

> Hi Jo,
>
> I tried this...
> http://www.xaraya.com/index.php/xarbb/topic/2952#12588
> ...but it didn't help.
>
> And I'm guessing this...
> http://www.xaraya.com/pipermail/xaraya_bugs/2005-October/011728.html
> ...is not going to work for PHP 5.
>
> The Apache version is 2.2.8.  I'm aware of this...
> http://www.xaraya.com/documentation/userguide/apb.html#apache2urls
> ...but in my case, I find that the short urls work in PHP 4.4.8 + Apache
> 2.2.8 without the need for AcceptPathInfo On.  And when I add
> AcceptPathInfo On to my htaccess, short urls still don't work with a
> switch to PHP 5.2.6.
>
> I'm pretty concerned about this, because I've moved five sites to this
> host (WireNine) in the last year or so, and it looks like I only have a
> week to either get short URLs working on this host or move the sites to
> another host.  They say they're dropping PHP 4 in about a week.  They
> put out a notice a while ago, but I guess I didn't understand the
> implications.  Naturally I don't relish the thought of moving five sites
> to a new host, especially when this one works so well in most respects.
>
> I wonder if there's anything else I can try to get short URLs working
> with suphp + PHP5?
>
> Doing without the short URLs isn't an option.  I use xarModURL in menus,
> so those links won't break, but there are plenty of links in the content
> area of pages that will break.  Also, it's just not a feature I'd want
> to do without.
>
> Lastly, I wonder if the suphp + PHP 5 is a problem only for Xaraya's
> directory-style URLs... or would this be a problem for all content
> management systems that provide an option for directory-style URLs?  
> Drupal, etc.  Not sure if anyone here can speak to that... but I figure
> if this setup is going to doom all directory-style URLs in all content
> management systems, then I should tell the host about that.
>
> Thanks!
> Ryan
>
>
>
>
>
> jojodee wrote:
>  
>> Ryan Walker wrote:
>>  
>>    
>>> Hi all,
>>>    
>>>      
>>   ...
>>  
>>    
>>> When I toggle the PHP version and view the phpinfo() output, I see that
>>> for both PHP 4 and PHP 5, the line for Server API says CGI.  Does that
>>> mean that PHP is being run as a CGI?  If so, I'm not sure why the short
>>> URLs are working in the PHP 4.4.8 scenario.
>>>    
>>>      
>> PHP is being run as CGI. There was a fix put in so that short urls did
>> run under CGI for php4.x.x (http://bugs.xaraya.com/show_bug.cgi?id=5071)
>> but i've not really looked at this problem since then.
>>
>>  
>>    
>>> There is a notice from the web host that says "Along with the PHP 5
>>> upgrade on all servers, we will be switching to suphp instead of
>>> mod_php."  Could that be a factor?
>>>    
>>>      
>> suphp does require the site to be running under CGI (suphp provides
>> similar functionality to apache suexec). Therefore there could be
>> problems if you are running php5 and cgi. There are a few posts around
>> about cgi/php5 and xaraya short urls and one of those solutions might
>> work for you. I'll try and take a look but can probably only test on
>> windows under cgi at the moment.
>>
>> Cheers
>> Jo
>>
>> [Note: you didn't mention what apache you were on. For apache2 you also
>> need AcceptPathInfo On for short urls in apache config or .htaccess file]
>>
>>
>>
>>  
>>    
>
>
>  


--
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Re: short URLs not working with PHP5 -- RESOLVED

by Ryan Walker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ryan Walker wrote:
>> Hi Jo,
>>
>> I tried this...
>> http://www.xaraya.com/index.php/xarbb/topic/2952#12588
>> ...but it didn't help.

I tried that again today and it worked.  I've now tried it in a few
different sites, all with this setup...

PHP 5.2.6 (suphp)
Apache 2.2.8
Xaraya 1.1.3

...and short urls work.  It also works in PHP 4.4.8  (suphp).  Phew.

-Ryan


--
Ryan Walker
www.WebCommunicate.net:
Insights and resources for effective websites.

_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Parent Message unknown Re: short URLs not working with PHP5 -- RESOLVED

by jojodee-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ryan

Thanks for taking the time to post back about your solution. Glad you
got it working.

Jo

Ryan Walker wrote:

> Ryan Walker wrote:
>>> Hi Jo,
>>>
>>> I tried this...
>>> http://www.xaraya.com/index.php/xarbb/topic/2952#12588
>>> ...but it didn't help.
>
> I tried that again today and it worked.  I've now tried it in a few
> different sites, all with this setup...
>
> PHP 5.2.6 (suphp)
> Apache 2.2.8
> Xaraya 1.1.3
>
> ....and short urls work.  It also works in PHP 4.4.8  (suphp).  Phew.
>
> -Ryan
>
>


--
http://xarigami.com :: Creative web development with Xaraya
http://2skies.com   :: Open source hosting and development
_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel

Parent Message unknown Re: short URLs not working with PHP5

by Jason-90 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ryan Walker wrote:

> For what it's worth, this what my web host had to say: "PHP4 will be
> permanently removed in the near future, as it's no longer being
> developed or maintained. suPHP with PHP 5 should not be affecting your
> ability to use mod rewrite to modify your script urls."
>
> Can someone tell me if there is something about the design of Xaraya's
> short url feature that makes it especially difficult to provide the
> feature when PHP is run as a CGI?  Is there something in the design of
> Xaraya that makes this inherently difficult?  Or is there some reason
> why this capability would come at too great a cost in terms of
> performance or some other consideration?  Frankly I don't have much
> knowledge of things at this level.  I'm not even sure what the meaning
> of "PHP as a CGI" really is.  I'm going to do more searching at
> xaraya.com and elsewhere to see if I can get a better understanding of
> how the short urls feature works and why it depends on mod_php... but
> I'm starting from zero knowledge, so it would be good to know if I'm
> headed down a dead end road.
>
> Thanks,
> Ryan

There is nothing in the way that Xaraya works that makes short URLs inherently
difficult under PHP5. I have been surprised at how easy it is to upgrade sites
to PHP5 - they just work with very little change.

I suspect the problems you are seeing are related to some other option set in
Apache or php.ini in your PHP5 instance, that is not in your PHP4 instance. Find
and fix that, and it should all work the same.

The most useful place to look, in upgrading to PHP5, is the Apache error log. I
find all sorts of things in there that help diagnose problems, especially
mod_security that keeps cropping up and killing processes in odd places.

-- Jason
_______________________________________________
Xaraya_devel mailing list
Xaraya_devel@...
http://xaraya.com/mailman/listinfo/xaraya_devel
LightInTheBox - Buy quality products at wholesale price