473,412 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

how php displays the output?

Hello,

If I have a PhP code below in a linux+apache environment,

==============================
<?php>
the first php block code
<?>

The HTML code goes here

<?php>
the second php block code
<?>

============================

does php open a temporary file to store the output from
"the first php block code"?
then combined with "The HTML code goes here" and then the output from
"the second php block code"? Then display the output of this temporary
file to web client and remove this temporary file afterwards?

Thanks,

Peter


Jul 17 '05 #1
7 1960
"peter" <on********@yahoo.com> wrote in message
news:gY**************@newssvr29.news.prodigy.com.. .
Hello,

If I have a PhP code below in a linux+apache environment,

==============================
<?php>
the first php block code
<?>

The HTML code goes here

<?php>
the second php block code
<?>

============================

does php open a temporary file to store the output from
"the first php block code"?
then combined with "The HTML code goes here" and then the output from
"the second php block code"? Then display the output of this temporary
file to web client and remove this temporary file afterwards?

Thanks,

Peter


sort of.

first it is <?php code ?> not <?php> code <?>

php reads in the entire file, glanses over it (parse) includes any files (
require() ) that need to be apart of it,
the it starts a top down aproach,

if output buffering is on, the output goes into memory, if its not, then it
goes to screen if full or flush() command is executed

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #2
CountScubula wrote:
"peter" <on********@yahoo.com> wrote in message
news:gY**************@newssvr29.news.prodigy.com.. .
Hello,

If I have a PhP code below in a linux+apache environment,

==============================
<?php>
the first php block code
<?>

The HTML code goes here

<?php>
the second php block code
<?>

============================

does php open a temporary file to store the output from
"the first php block code"?
then combined with "The HTML code goes here" and then the output from
"the second php block code"? Then display the output of this temporary
file to web client and remove this temporary file afterwards?

Thanks,

Peter

sort of.

first it is <?php code ?> not <?php> code <?>

php reads in the entire file, glanses over it (parse) includes any files (
require() ) that need to be apart of it,
the it starts a top down aproach,

if output buffering is on, the output goes into memory, if its not, then it
goes to screen if full or flush() command is executed


Thanks. Mike.
What I am concerned is about its performance if every request for php
code will open/close a file and delete it afterwords.

What you mean "output goes to screen" is to send out directly to the
client, right? If the output goes into memory, the performance should
be good. I am not sure how big memory should php allocate in advance to
hold the output internaly.

Thanks,

Peter


--
Mike Bradley
http://www.gzentools.com -- free online php tools


Jul 17 '05 #3
"peter" <on********@yahoo.com> wrote in message
news:4q**************@newssvr29.news.prodigy.com.. .

Thanks. Mike.
Youe welcome
What I am concerned is about its performance if every request for php
code will open/close a file and delete it afterwords.

What you mean "output goes to screen" is to send out directly to the
client, right? If the output goes into memory, the performance should
be good.
In this example yes, generaly it goes to std output, and when run with a web
server, yes to the browser.
with std output, you can pipe stuff in and out if a php script if you need
to.

I am not sure how big memory should php allocate in advance to hold the output internaly.

Thanks,
Peter


The default setting should suffice, only modify if it becomes a problem.
Now if you have intensive php scripts with data manipulation, then
lots-o-ram is good with a fast cpu.

some of my scripts have been so intensive, they can bring down a 1 GHz singe
cpu with 512KB ram.
I have a proccess/backup data sever that is on a quad 2.4 GHz machine with 2
GB Ram, its my powerhouse. It actualy remotely grabs data from other servers
and backs up into zip files, for a span of the last 30 days, and has all my
data center monitoring on it, from room temp to stats on the switches (far
beyond MRTG)
--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #4
On Tue, 06 Jan 2004 21:41:33 GMT, peter <on********@yahoo.com> wrote:
does php open a temporary file to store the output from
"the first php block code"?
then combined with "The HTML code goes here" and then the output from
"the second php block code"? Then display the output of this temporary
file to web client and remove this temporary file afterwards?


No, it doesn't use any temporary files.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #5
Andy Hassall wrote:
On Tue, 06 Jan 2004 21:41:33 GMT, peter <on********@yahoo.com> wrote:

does php open a temporary file to store the output from
"the first php block code"?
then combined with "The HTML code goes here" and then the output from
"the second php block code"? Then display the output of this temporary
file to web client and remove this temporary file afterwards?

No, it doesn't use any temporary files.


thanks for your information. I think using temporary file will hurt
performance. Do you have some ideas how it is handled?

thanks.

Peter
Jul 17 '05 #6
CountScubula wrote:
"peter" <on********@yahoo.com> wrote in message
news:4q**************@newssvr29.news.prodigy.com.. .
Thanks. Mike.

Youe welcome

What I am concerned is about its performance if every request for php
code will open/close a file and delete it afterwords.

What you mean "output goes to screen" is to send out directly to the
client, right? If the output goes into memory, the performance should
be good.

In this example yes, generaly it goes to std output, and when run with a web
server, yes to the browser.
with std output, you can pipe stuff in and out if a php script if you need
to.

I am not sure how big memory should php allocate in advance to
hold the output internaly.

Thanks,
Peter

The default setting should suffice, only modify if it becomes a problem.


Not sure what is the default settings for memory size to hold the output
from a php script. What if the default memory size settings cannot hold
the output? allocate another segment of memory with the default size? or
increase the default memory size?

I assume mod_php handles the similar way as mod_perl, thus, both
scripting languages has similar performance.


Now if you have intensive php scripts with data manipulation, then
lots-o-ram is good with a fast cpu.
That is true. Thanks,

Peter

some of my scripts have been so intensive, they can bring down a 1 GHz singe
cpu with 512KB ram.
I have a proccess/backup data sever that is on a quad 2.4 GHz machine with 2
GB Ram, its my powerhouse. It actualy remotely grabs data from other servers
and backs up into zip files, for a span of the last 30 days, and has all my
data center monitoring on it, from room temp to stats on the switches (far
beyond MRTG)
--
Mike Bradley
http://www.gzentools.com -- free online php tools


Jul 17 '05 #7
peter wrote:
thanks for your information. I think using temporary file will hurt
performance. Do you have some ideas how it is handled?


Assume there is no caching anywhere (not on php, not on the webserver,
not on proxies, not on the client browser)

<?php
// headers have already been sent to the client browser
// it's now 23:44:55.376544
echo 'a'; // the 'a' is sent to the client on 23:44:55.376591
sleep(10);
?>
<br/> <!-- this line is sent to the client on 23:45:05.377052 -->
<?php
sleep(10);
echo 'z'; // the 'z' is sent to the client on 23:45:15.377107 :)
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #8

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

Similar topics

2
by: Goldfisch1980 | last post by:
Hi! I read an dBase table under Win XP by the common dBase functions of PHP 4.3.5. But all records are displayd with a wrong charset. All umlauts of the databasefile like "öäüéô"... and so on...
8
by: Jack | last post by:
Hi, I got a asp page where a variable BudgetTotal is calculated as below: BudgetTotal = (rstemp.Fields("FedBudget") + rstemp.Fields("StateBudget") + rstemp.Fields("LocalBudget")) Initially,...
3
by: Dan | last post by:
Question on how to do this. I'm trying to make a script that has 3 text fields in a form. When a start time is entered in a text field in the form the other 2 fields display the time with a set...
6
by: Ray Cassick \(Home\) | last post by:
I am looking for a control that displays simple HTML text (just basic tags, not active content needed). I know I can use the IE ActiveX control but really want to stay away from the headaches if...
0
by: letsgetsilly | last post by:
I am populating a datagrid and outputting it to excel. Everything worked well last night, but today excel only displays the content in font color white, which is impossible to see. The data is all...
3
by: egarobar | last post by:
I am using Access 2003 (on WinXP) to read from an Oracle db, where there is a table with a CLOB which is a variable-size text field. In the 'linked table' which is created in the Tables panel of...
4
by: Michael | last post by:
I have both PHP and Apache installed on my Windows machine. When I open up a PHP script file in my browser, the output goes to a DOS Window (and the window closes immediately upon completion of...
9
by: sovht | last post by:
System: Intel, Windows XP Pro, SP2 IDE: VC++ 6.0 Problem: *Very* simple program to create a MessageBox only ever displays the first character of the given string. I checked the spec for the...
4
by: sebastien.willemijns | last post by:
hello, i use a small PHP script to grab DNS infos at http://80.247.230.136/bug/php/ (php and txt available) the trouble is the last line of every output given by "system" function is always...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.