473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1967
"peter" <on********@yah oo.com> wrote in message
news:gY******** ******@newssvr2 9.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********@yah oo.com> wrote in message
news:gY******** ******@newssvr2 9.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********@yah oo.com> wrote in message
news:4q******** ******@newssvr2 9.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********@yah oo.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********@yah oo.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********@yah oo.com> wrote in message
news:4q******** ******@newssvr2 9.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
3700
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 are not displayed or are displayed in a wrong way! :-( How can I set the correct charset for the table, that all umlauts keep save?
8
1291
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, when I check this variable value, it displays according to the following command. Response.Write "Total Budget" & "<br>" Response.Write BudgetTotal & "<br>"
3
1402
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 amount of hours and minutes added. Example: Text Box 1 - I enter Start Time
6
1303
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 I can. There has to be some type of lite control out there that can handle this. I am hacked off that the RTF control will not read HTML. RTF tags are WAY too much work for what I need to do. --
0
5261
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 there but invisible. I am unable to change any type of properties within excel to have the font color change. I have tried changing every attribute on the datagrid that I can think of, and I have also outputted to just a plain generic auto-generate...
3
4581
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 Access, the CLOB becomes a Memo field. I need to create a report that displays the data from this CLOB in the correct format. The data in the CLOB contains any number of chr(13), i.e. Carriage Returns, without LF, to separate lines of data that are...
4
1937
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 the script). Can anyone tell me how I can get the script output to display in the browser? Thanks; appreciate your help.
9
7971
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 MessageBox function and I believe I am adhering to it. I have also done a search for this issue, but have come up empty handed. Perhaps my search parameters were at fault ... #include <windows.h> // added to make MessageBox work (esp w/MB_<code>s)...
4
1923
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 displayed twice, is it really a bug ? http://80.247.230.136/bug/php/indexe.php?ip=willemijns.com
0
7874
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
8241
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8366
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
7997
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
8227
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
6646
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...
1
5738
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3853
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
1203
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.