Re: PHP and Apache

From: Date: Mon, 04 Sep 2000 13:36:53 +0000
Subject: Re: PHP and Apache
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2398@lists.php.net to get a copy of this message
Jaco: In the old days of DOS (before Windows) there was a concept widely known: Standard Input and Output. That is, a console application would take its input from the STD_IN device and would send its output to the STD_OUT device. I bet that this is exactly what PHP does, it sends its output to the STD_OUT device. If it runs from the command line, standard output is the screen, but if Apache (or any other web server) runs it, that application will capture (or redirect) the STD_OUT device, so that output from PHP is sent to the requesting browser. In this same manner, you can run PHP like this: php some_script.php >output.html you won't see anything on the screen, but a file named 'output.html' will be created. It will contain all the output generated by the script. Saludos, Pablo Vera _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Monday, September 04, 2000, 1:31:41 AM, Jaco wrote: JvdM> Hello, JvdM> The relevant setup is: Win98/php3/apache web server (or any other web server...) JvdM> I have a good idea of how web servers work. It takes requests from browsers and returns the JvdM> relevant output to the browser. I know how this works for a normal html page, but how does it work JvdM> when you request a php page? JvdM> I know it has to execute php somewhere in the middle. I played around with php, running it JvdM> from the command line, and then getting the result as output to the screen. What I want to know JvdM> is...How does apache tell php where to send the output? If apache had to just execute php, JvdM> it would still send the output to the screen, right?, and it has to go to the browser. Can someone JvdM> explain this concept to me? Some may say: "Just except the fact that the thing works, JvdM> and leave it at that!", but I would like to know how this is done, 'cause I find it JvdM> interesting. JvdM> If someone could just explain this to me, I would be grateful... JvdM> Thanx. JvdM> Jaco van der Merwe JvdM> Email: jaco@webapps.co.za JvdM> Phone: +27 83-725-0281 JvdM> ICQ: 73549286

« previous php.windows (#2398) next »