$_SERVER["PHP_SELF"] timeout
This has me baffled:
I've got a simple piece of code-
<?php
echo ($_SERVER[\"PHP_SELF\"]);
?>
Other $_SERVER indexes show up fine, but this locks up a bit and ends after 30 seconds.
I'm running Xitami with PHP 4.2.2 on WinXP.
Ideas? Need more details?
Thanks.
Busy posted this at 08:44 — 13th November 2002.
He has: 6,151 posts
Joined: May 2001
tried single quotes
echo ($_SERVER['PHP_SELF']);
or without the brackets
echo $_SERVER["PHP_SELF"];
Abhishek Reddy posted this at 10:56 — 13th November 2002.
He has: 3,348 posts
Joined: Jul 2001
Tried both. Same result.
Thanks anyway.
dk01 posted this at 14:27 — 13th November 2002.
He has: 516 posts
Joined: Mar 2002
Why not just use $PHP_SELF ?
-dk
Mark Hensler posted this at 17:22 — 13th November 2002.
He has: 4,048 posts
Joined: Aug 2000
Can you access it via $GLOBALS["PHP_SELF"] or $HTTP_SERVER_VARS["PHP_SELF"] ?
And what is Xitami?
hagar posted this at 22:30 — 13th November 2002.
They have: 104 posts
Joined: Oct 2002
its an open source webserver
http://www.xitami.com/
Mark Hensler posted this at 22:49 — 13th November 2002.
He has: 4,048 posts
Joined: Aug 2000
Have you tried the same script using Apache on the same box?
Do you still have the same problem?
Abhishek Reddy posted this at 03:37 — 14th November 2002.
He has: 3,348 posts
Joined: Jul 2001
dk01, $PHP_SELF is an undefined variable.
Mark, I've just tried $HTTP_SERVER_VARS and $GLOBALS. $HTTP_SERVER_VARS gives me a timeout. $GLOBALS gives an undefined index error.
In any case, this isn't a big deal. What I really need for now is to use SERVER_NAME, and that works, so it's ok.
I don't have Apache but I'm going to install it soon. Maybe PHP_SELF will work in that environment. I use Xitami because it's a handy little program, and is hardly a resource hog. It's like a good working version of PWS, that supports CGI/PHP. Simply, it does what it's supposed to do. (Well, until now, of course. )
zollet posted this at 04:35 — 14th November 2002.
He has: 1,016 posts
Joined: May 2002
Abhi, from what I've understood $_SERVER["PHP_SELF"] (aka $PHP_SELF) works only with Apache. For other webservers you should try $_SERVER["SCRIPT_NAME"] (aka $SCRIPT_NAME).
Mark Hensler posted this at 04:46 — 14th November 2002.
He has: 4,048 posts
Joined: Aug 2000
After reading zollet's post, I had to check the manual... (I didn't remember anything about 'SCRIPT_NAME')
From that, I'm guessing that Xitami is running *.php files from a command-line (like a shell), and returning the output.
Mark Hensler
If there is no answer on Google, then there is no question.
Abhishek Reddy posted this at 04:53 — 14th November 2002.
He has: 3,348 posts
Joined: Jul 2001
It works. I never knew of SCRIPT_NAME.
Thanks, guys.
Busy posted this at 08:03 — 14th November 2002.
He has: 6,151 posts
Joined: May 2001
Abhishek if you or anyone else wants the bundle php/mysql/apache/perl/mysql + manuals check out firepages.com.au
Abhishek Reddy posted this at 08:09 — 14th November 2002.
He has: 3,348 posts
Joined: Jul 2001
Wow, thanks for that.
I haven't visited firepages since... what, about two years ago? fp has sure done a lot of work.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.