Home > Archive > PHP Programming > February 2006 > bad PHP documentation and how to pass args alternatively
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
bad PHP documentation and how to pass args alternatively
|
|
| mmaenz@yahoo.de 2006-02-25, 9:55 pm |
| Hi,
I wrote a Webserver by my own and I would like to support php.
But I can't find any information about where php gets the information
$_SERVER['xxx'] from.
At the moment, I pass all arguments as parameter to the call to php
php -f index.php p1=xx p2=xx ... and so on. But the $_SERVER parameter
won't work.
But with HTTP POST or PUT, (with files for example), I need another way
to
pass arguments to php. I tried stdin, had no luck.
My webserver only supports GET with PHP at the moment, but Scripts use
GET /
POST / PUT.
Early versions of PHP generated their HTTP Response Header
automatically.
Newer Versions don't do. Is there any special argument for php (
-with_header, or
so) or only the option with generating own header in the script? Most
scripts don't do that and therefore don't work on the basis of HTTP1.1!
It
may works but isn't very good.
Are all Errors put out on stdout? I never get any errors on Stderr. PHP
always put's out the errors on stdout. And that sucks really hard. If
the
script generates any errors, i want them to be reported on stderr in
order
to display an alternative page as errorpage. In my opinion, the PHP
errors
are giving away to much Information about the server and his structure.
Any help is really welcome!!
thx in advance
- Michael
________________________________________
_____________________________
Linux is Luke. FreeBSD is Yoda.
--Anonymous
| |
|
| mmaenz@yahoo.de wrote:
>
> I can't find any information about where php gets the information
> $_SERVER['xxx'] from.
>From the operating system. On Unix, you can view the environment
variables and their values using the 'env' command; on Windows, you can
use 'SET'. Both OSs provide means to obtain environment variables and
their values programmatically.
> Are all Errors put out on stdout?
No, they are written into stderr.
> In my opinion, the PHP errors are giving away to much
> Information about the server and his structure.
Of course. It is very useful during debugging. And, moreover, you can
turn error display off (recommended on production servers).
Cheers,
NC
| |
| mmaenz@yahoo.de 2006-02-26, 7:55 am |
| Thx NC for your reply.
It works.
|
|
|
|
|