By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

bad PHP documentation and how to pass args alternatively

P: n/a
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

Feb 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
NC
mm****@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

Feb 25 '06 #2

P: n/a
Thx NC for your reply.

It works.

Feb 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.