PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



output_buffering problem: PHP page cannot load fully. Help.

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
KAN



Joined: 20 Dec 2006
Posts: 6
Location: MENTAL HOSPITAL

PostPosted: Mon Nov 23, 2009 2:56 pm    Post subject: output_buffering problem: PHP page cannot load fully. Help. Reply with quote

I have a PHP page that runs flawlessly on Apache 2.2.8 (for Windows), PHP 5.2.5 (for Windows), and Windows XP.

Now I am to deploy the PHP on the production server. It is CentOS 4.2 (32-bit x86), with Apache 2.2.14 and PHP 5.2.11. Both Apache and PHP are compiled, with all the needed components. The compilation process ran smoothly.

However, my PHP page only loads partially in the production server. The production server's never loads the page fully, ie, when showing the codes in a browser, it never reaches the closing </html> part. And it has nothing to do with bandwitdh either, I have tried browsing locally from the server itself.

I have to admit that my php page is quite large, about 9 kilobytes. It also has a lot of "echo" commands. The page also contains a lot of tab.

Recently I found out that it has something to do with output_buffering parameter in php.ini. Starting from zero, if I increase the output_buffering value, the loaded portion of my PHP page also increases. So I think if I max the output_buffering value, my PHP page will be fully loaded by the server.

Alas, that's not the case.

See, when I reach certain value, the loaded portion of the PHP page decreases again. The page reaches its biggest portion in output_buffering=1024. Increasing it to 1025, for example, doesn't change anything. But when I set it to 1210, the

Here's what happen when I set output_buffering=0. The page does not load fully, it only shows the HTML header and the toolbar.

output_buffering=0

At output_buffering=512, more portions of the PHP page starts to show up, evident by the code lines below the toolbar.

output_buffering=512

Apparently, output_buffering=1024 is the "optimum" setting, although it still fails to load the PHP page fully. The page you see below is not the full PHP page, by the way.

output_buffering=1024

I don't know if it is relevant, but originally, the php.ini has extension_dir = './' Problem is, I don't know what does it mean by './' (is it /usr/local/apache2/php ? is it /usr/local/apache2/lib ?). On the other hand, I need to dl php_mapscript.so into my PHP page, which I put in PHP installation prefix (/usr/local/apache2/php). So I hardcoded the extension_dir into '/usr/local/apache2/php'.

In short, what's wrong? Why the production server cannot load my PHP page fully? What should I do? Please help. Sad
Back to top
View user's profile Send private message
KAN



Joined: 20 Dec 2006
Posts: 6
Location: MENTAL HOSPITAL

PostPosted: Mon Nov 23, 2009 3:16 pm    Post subject: Reply with quote

By the way, I forgot to mention, but I also tried using implicit_flush = On. When I use implicit_flush = On with output_buffer = 0, it works just exactly like using implicit_flush = Off with output_buffer = 1024.

However, increasing output_buffer with implicit_flush = On does not improve the situation. For example, using implicit_flush = On with output_buffer = 1024 does not fully load the PHP page either. Seems like nothing can fully load my PHP page.

What's wrong? What happens?
Back to top
View user's profile Send private message
KAN



Joined: 20 Dec 2006
Posts: 6
Location: MENTAL HOSPITAL

PostPosted: Tue Nov 24, 2009 12:03 pm    Post subject: Reply with quote

Ah, I've just found something new: the same output_buffering value does not always give consistent result.

For example, I just set output_buffering value to 3650, which showed most (alas, not the entire) of my PHP page. But about five minutes later, the same 3650 value just gave me a totally blank page (just like when I'm using output_buffering=On)

By the way, and I don't know if it's relevant, but it is a production server, which is also used by the "primary" website and a web mail server.
Back to top
View user's profile Send private message
KAN



Joined: 20 Dec 2006
Posts: 6
Location: MENTAL HOSPITAL

PostPosted: Sat Nov 28, 2009 2:16 pm    Post subject: Reply with quote

Problem solved: I eventually use fgs, which comes with ready-to-use Apache and PHP binary, instead of using my own compiled Apache/PHP. And it works. It now shows my PHP page fully instead of being truncated.

I don't understand what happens to my own compiled PHP/Apache though. Maybe because I'm using CentOS 4.2? Maybe the libraries needed for compilation are already old?
Back to top
View user's profile Send private message
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



PHP Code Examples
 Stream diffrent sizes of images from a single image to save disk space.
 JavaScript dropdown list menu to switch any page.
 Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
 PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
 Link Extractor - This function is used to extract links from a given URL. This will convert relative path into absolute path and also remove PHPSESSID stuff.
 Building a Dynamic Form using Javascript and innerHTML. Add form elements in realtime without refreshing the page.
 A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function.
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum