473,804 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bad PHP documentation and how to pass args alternatively

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
2 1337
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 programmaticall y.
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
Thx NC for your reply.

It works.

Feb 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
9716
by: Bharath Dhurjati | last post by:
Hello, I am looking for documentation that specifies the following behavior exhibited by java. The following (assuming MyClass.class is accessible and has a main()) java MyClass * yields the same result on Windows as on Unix, inspite of Windows not
3
2737
by: Helmut Jarausch | last post by:
Hi, according to the docs the following should work (IMHO) import csv csv_file= file('test.csv') Inp= csv.DictReader(csv_file,,\ lineterminator='\n')
6
6634
by: Harri Pesonen | last post by:
How do I pass the calling C++ class reference (or anything) to a callback? My code is: static PyObject* emb_Set(PyObject *self, PyObject *args) { char *key, *value; if(!PyArg_ParseTuple(args, "ss", &key, &value)) return NULL; // do something with the C++ class here
0
2458
by: Matt | last post by:
My problem is to allow ASP to interact with JSP, and I pass JavaScript object in my approach, but I wonder if it will work in network, not just in local machine. For testing purposes, the following are page1.html and page2.html that use Array JavaScript object to pass data back and forth. page1.html is able to transfer data to page2.html, but page2.html has trouble to transfer data back to page1.html.
12
38522
by: Huskier | last post by:
Hi all: I want to pass a class-member function to pthread_create, and my code is in the following, but I don't know how to pass myobj.thread_function to pthread_create function. #include <pthread.h> class test { public:
1
2205
by: Sivaraman.S | last post by:
Hi, Can i pass integer array to methodInfo.Invoke(obj,args()). I am able to pass only string array to this function. This is the code i have written. Dim myType As Type = objClass.GetType() Dim myMethod As MethodInfo = myType.GetMethod("strFnName") myMethod.Invoke(objClass, Args) here "strFnName" is the function name and args() is the string array. args()
4
9416
by: tony.ha | last post by:
Hello, I have open a Python program in the IDLE, but when I select the "run module" under "run" menu, it does not allow me to pass an argument to my Python program! How do you pass an argument to a Python program under the IDLE? Thanks for you help!
1
9477
by: skillzero | last post by:
Is there a portable way to pass a va_list as a parameter to another function taking a variable argument list? I have a function that takes a printf-like format string and I'd like to use something like %V to pass in another format string and a va_list to allow nesting. It happens to work on my compiler, but I wasn't sure if it's portable to use va_list's as parameters to a variable argument function because va_list isn't always just a...
3
2405
by: swetha123 | last post by:
hello, I don't know how to use cookies please help me in this I am using the dream weaver cs4 I designed the navigation bar to my page using dream weaver cs4 navigation bar contains Home, Retail Contact Us
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.