Where did path_info go?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Sep 17, 2006 6:57 pm    Post subject: Where did path_info go? Reply with quote

Hello.

I have PHP version 5.1.2. I am wondering why $_SERVER['PATH_INFO'] is not an environmental variable. PATH_INFO still works fine in Perl, but not in PHP.

Has anyone seen any documentation about this? I'd really like to have this variable available to use!
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
abyssisthebest
-


Joined: 30 Jun 2005
Posts: 319
Location: Boston, UK

PostPosted: Sun Sep 17, 2006 8:17 pm    Post subject: Reply with quote

You can use
Code:
<?php
pathinfo('/folder/file.html');
?>

I think it was removed becuase it had something to do with $_SERVER['translated_path']
_________________
My online Portfolio
Back to top View user's profile Send private message Send e-mail MSN Messenger
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Sep 17, 2006 9:27 pm    Post subject: Reply with quote

Thanks for the help, abyssisthebest. I'm researching pathinfo().

I found a way to get around the lack of $_SERVER[PATH_INFO].

Here is code that will display everything in the URL after the actual requested page (equivalent PATH_INFO and QUERY_STRING):
Code:
echo substr($_SERVER[REQUEST_URI], strlen($_SERVER[PHP_SELF]));


Examples:
Requested Page --> /index.htm/testing
Code result --> /testing

Requested Page --> /index.htm/testing.gif?12345
Code result --> /testing.gif?12345
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Sep 18, 2006 3:32 pm    Post subject: Re: Where did path_info go? Reply with quote

pkSML,

It's because PHP does not conform to CGI by default and requires that the script path is passed to it in PATH_INFO. That's by the way why you are instructed to configure the PHP interpreter type to be set to "PHP Style".

To enable PATH_INFO, you'd have to set php.ini accordingly (there are parameters there to enable it to work in a CGI conformant way) and set the interpreter type in Abyss Web Server to "Standard".
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
R031E5
-


Joined: 30 Dec 2006
Posts: 4

PostPosted: Sat Dec 30, 2006 5:48 pm    Post subject: Huh? Reply with quote

So... how is it done?

I'm trying to install gallery and I would really appreciate if somebody could post a method to do the path_info variable an environmental one.

Thanks :wink:
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Dec 31, 2006 2:39 pm    Post subject: Re: Huh? Reply with quote

R031E5,

Quote:
To enable PATH_INFO, you'd have to set php.ini accordingly (there are parameters there to enable it to work in a CGI conformant way) and set the interpreter type in Abyss Web Server to "Standard".

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
R031E5
-


Joined: 30 Dec 2006
Posts: 4

PostPosted: Wed Jan 03, 2007 7:24 pm    Post subject: Re: Huh? Reply with quote

aprelium wrote:
R031E5,

Quote:
To enable PATH_INFO, you'd have to set php.ini accordingly (there are parameters there to enable it to work in a CGI conformant way) and set the interpreter type in Abyss Web Server to "Standard".


Please forgive my ignorance, I've already set the interpreter to "Standard" but I can't find a way to enable it to work in a CGI conformant way, do I have to force the redirection (cgi.force_redirect) or what?

I've googled the problem and I came up with a non working line of code: cgi.fix_pathinfo = 1

Any help would be very appreciated

Thanks :)
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Jan 04, 2007 1:11 pm    Post subject: Re: Huh? Reply with quote

R031E5 wrote:
I've googled the problem and I came up with a non working line of code: cgi.fix_pathinfo = 1


That's the parameter that you should set in php.ini to make it work conforming to the CGI specification. Why do you say it is not working? What tests have you done?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
R031E5
-


Joined: 30 Dec 2006
Posts: 4

PostPosted: Thu Jan 04, 2007 7:22 pm    Post subject: Re: Huh? Reply with quote

aprelium wrote:
R031E5 wrote:
I've googled the problem and I came up with a non working line of code: cgi.fix_pathinfo = 1


That's the parameter that you should set in php.ini to make it work conforming to the CGI specification. Why do you say it is not working? What tests have you done?


I've installed gallery (http://gallery.menalto.com/), it has a built in function to check if path info is installed, I'm kinda new to all this php stuff so please bear with me.

Is this supported in previous versions to X2? If not I'm not going to waste your time, I think that i'm gonna buy it, Abyss web server is the best one I've ever seen, even better than apache, it's easier to customize and it's very flexible.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Jan 05, 2007 12:37 pm    Post subject: Re: Huh? Reply with quote

R031E5 wrote:
aprelium wrote:
R031E5 wrote:
I've googled the problem and I came up with a non working line of code: cgi.fix_pathinfo = 1


That's the parameter that you should set in php.ini to make it work conforming to the CGI specification. Why do you say it is not working? What tests have you done?


I've installed gallery (http://gallery.menalto.com/), it has a built in function to check if path info is installed, I'm kinda new to all this php stuff so please bear with me.


We'll give that script a try and see what it checks for path_info. But please send us a reminder if you do not get a response after 48 hours.

Quote:
Is this supported in previous versions to X2? If not I'm not going to waste your time, I think that i'm gonna buy it, Abyss web server is the best one I've ever seen, even better than apache, it's easier to customize and it's very flexible.


We're not sure what you mean by "Is this supported in previous versions to X2?". Languages support and all the features work the same on X1 and X2 except multiple site hosting and bandwidth throttling.

The feature you're referring to 'path_info on PHP' is not something we can fix on our side, it's something related to PHP and its configuration (other languages get their path_info variable without any problem, only PHP needs a special mode because of its unconformance to the specifications).

Thank you for your positive feedback about Abyss Web Server. We're glad reading that you plan to upgrade to the professional edition X2.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group