<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 03:58:23 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ilia Alshanetsky's Blog: PHP's Output Buffering]]></title>
      <guid>http://www.phpdeveloper.org/news/17230</guid>
      <link>http://www.phpdeveloper.org/news/17230</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Ilia Alshanetsky</i> takes a look at PHP's output buffering feature and some <a href="http://ilia.ws/archives/244-PHPs-Output-Buffering.html">interesting things he found</a> when testing some recent code (hint: it has to do with PHP's "interesting" management of the buffer).
</p>
<blockquote>
While profiling our application I came across a a rather strange memory usage by the ob_start() function. We do use ob_start() quite a bit to defer output of data, which is a common thing in many applications. What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory, given that the data being buffered rarely exceeds 1-2kb, this was quite unusual.
</blockquote>
<p>
Through a bit more testing he found that, if a buffer provided for content isn't enough, PHP automatically bumps it up by 10kb each time - a waste of resources if you only need a small subset of that. He includes a small patch he made to the PHP core API that allows for defining a custom buffer size and, if it's not enough, bumps up the buffer size by 1kb instead of 10kb.
</p>]]></description>
      <pubDate>Thu, 08 Dec 2011 10:01:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: fatal: The remote end hung up unexpectedly]]></title>
      <guid>http://www.phpdeveloper.org/news/17089</guid>
      <link>http://www.phpdeveloper.org/news/17089</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a <a href="http://www.eschrade.com/page/fatal-the-remote-end-hung-up-unexpectedly">quick tip</a> for anyone using <a href="http://phpcloud.com">phpcloud.com</a> and having trouble with git and "remote end hung up" error messages.
</p>
<blockquote>
If  you are using phpcloud.com and are experiencing errors with git [...] and you are trying to push large files (not sure what is defined as "large") you may need to change some git settings.
</blockquote>
<p>
He points out two settings - one for Windows and the other for Linux - that increase the buffer size to handle larger files that might be included in your repository.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 12:55:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Speed Up Your Website with PHP Buffer Flushing]]></title>
      <guid>http://www.phpdeveloper.org/news/15353</guid>
      <link>http://www.phpdeveloper.org/news/15353</link>
      <description><![CDATA[<p>
New from the SitePoint blog, there's an article from <i>Craig Buckler</i> about <a href="http://blogs.sitepoint.com/2010/10/29/faster-web-pages-php-buffer-flush/">using buffer flushing</a> to increase the load times of your applications and websites.
</p>
<blockquote>
Output buffering makes this process quicker and more efficient. The buffer is essentially a big memory-resident string. When text is output, it's appended to the buffer rather than returned to the browser immediately. The buffer is then "flushed", i.e. its contents are transmitted and the string is reset pending further output. 
</blockquote>
<p>
He notes the instances where the buffer would be flushed - end of page, exceeds number of bytes allowed or a manual flush is called - and code snippet example of a simple flushing setup. He also asks for some feedback on this method, so be sure to <a href="http://blogs.sitepoint.com/2010/10/29/faster-web-pages-php-buffer-flush/#comments">look at the comments</a> for more thoughts from the community.
</p>]]></description>
      <pubDate>Fri, 29 Oct 2010 08:34:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Live video streaming with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15153</guid>
      <link>http://www.phpdeveloper.org/news/15153</link>
      <description><![CDATA[<p>
In a new post to his blog today <i>Gonzalo Ayuso</i> talks about <a href="http://gonzalo123.wordpress.com/2010/09/20/live-video-streaming-with-php/">video streaming and PHP</a>. Well, okay, not so much using PHP for playing the video, more for the security and streaming around the streaming feeds.
</p>
<blockquote>
For example we want to show videos only to registered users based on our authentication system. Imagine we're using sessions for validate users. That's means we cannot put the media in a public folder and point our media player to those files. We can obfuscate the file name but it'll remain public. In this small tutorial We're going to see how to implement it with PHP.
</blockquote>
<p>
Since the video stream he wants to deal with is a live one (and not a single video file that can be read all at once) he shows how to use the <a href="http://php.net/manual/en/book.outcontrol.php">output buffering</a> functions in PHP to output small chunks of the data at a time with the correct <a href="http://php.net/header">headers</a> attached.
</p>]]></description>
      <pubDate>Mon, 20 Sep 2010 08:46:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: ob_start and HTTP headers]]></title>
      <guid>http://www.phpdeveloper.org/news/13947</guid>
      <link>http://www.phpdeveloper.org/news/13947</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has a new post to his blog today looking at something it's common for web applications to use, <a href="http://php.net/ob_start">ob_start</a>, and <a href="http://brian.moonspot.net/php-ob-start-headers">what about HTTP headers</a> makes it work to prevent the infamous "headers already sent" message.
</p>
<blockquote>
HTTP is the communication protocol that happens between your web server and the user's browser.  Without too much detail, this is broken into two pieces of data: headers and the body.  The body is the HTML you send. But, before the body is sent, the HTTP headers are sent.
</blockquote>
<p>
He includes a sample raw HTTP response for a page and how the <a href="http://php.net/ob_start">ob_start</a> function works to buffer the output of the resulting page to save the header information until the buffer is echoed or cleaned out. There is a down side he mentions, though - there's no partial buffering built in so it's an all or nothing short.
</p>]]></description>
      <pubDate>Mon, 01 Feb 2010 14:38:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kae Verens' Blog: Serving files through a script]]></title>
      <guid>http://www.phpdeveloper.org/news/11738</guid>
      <link>http://www.phpdeveloper.org/news/11738</link>
      <description><![CDATA[<p>
<i>Kae Verens</i> has <a href="http://verens.com/archives/2009/01/13/serving-files-through-a-script/">posted a quick tutorial</a> about serving up files by routing them through a "fetch" script, pulling their contents in one side and back out the other.
</p>
<blockquote>
One thing I need to do while building the multi-user version of <a href="http://webme.eu/">webme</a> is to convert it so file references such as /f/photos/an_image.jpg get transparently converted so they serve correctly, even though the actual file may be located somewhere entirely else.
</blockquote>
<p>
There's two steps involved - rewriting the URL request for the types of files you'd like to pull through the script (using some mod_rewrite magic in Apache) and make the script to do the actual work. Source for that is included too. Not only can something like this help you keep things organized but it also allows for extra security if you need to store the files outside of the webserver's document root.
</p>]]></description>
      <pubDate>Wed, 14 Jan 2009 09:37:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Output Buffering ]]></title>
      <guid>http://www.phpdeveloper.org/news/10950</guid>
      <link>http://www.phpdeveloper.org/news/10950</link>
      <description><![CDATA[<p>
<a href="http://www.devshed.com/c/a/PHP/Output-Buffering/">This new tutorial</a> from DevShed introduces something that could make a pretty profound impact on your application if used correctly - output buffering.
</p>
<blockquote>
Output control (or output buffering) allows you to write and execute your scripts normally but send data to the web browser at selected times. The main benefit of this system is that you can call the header(), setcookie() and session_start() functions at any place in your scripts without having to worry about the "headers already sent" error message.
</blockquote>
<p>
They start with the basics - the functions and what they do - then move on to an example, a login form, that uses the buffering to capture errors and html to be flushed and echoed at the end.
</p>]]></description>
      <pubDate>Wed, 03 Sep 2008 08:48:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Internet Super Hero Blog: mysqlnd saves 40% memory, finally (new tuning options)!]]></title>
      <guid>http://www.phpdeveloper.org/news/8536</guid>
      <link>http://www.phpdeveloper.org/news/8536</link>
      <description><![CDATA[<p>
Even more good news for mysqlnd users out there - according to <a href="http://blog.ulf-wendel.de/?p=157">this new post</a> on the Internet Super Hero blog, some of the tuning options it enables can help you save 40% of the memory you were using before.
</p>
<blockquote>
mysqlnd saves memory. It consumes half as much memory as libmysql. This is what we have been convinced of. This is what we taught you. Then I tried to test it and made Andrey get nervous for a few hours'¦ Meanwhile he is fine again and we can announce: mysqlnd saves memory, not only in theory, we tested it - we can proof it, can we?
</blockquote>
<p>
The <a href="http://blog.ulf-wendel.de/?p=157">proof</a> comes in the form of a few "tricks" and some of the settings that the software can use to optimize buffer sizes. Benchmarks (and the code to run them) are also included to show what the differences are between mysqlnd and libmysql.
</p>]]></description>
      <pubDate>Mon, 27 Aug 2007 12:11:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Secunia: Cisco Products PHP "htmlentities()" and "htmlspecialchars()" Buffer Overflows]]></title>
      <guid>http://www.phpdeveloper.org/news/7711</guid>
      <link>http://www.phpdeveloper.org/news/7711</link>
      <description><![CDATA[<p>
Cicso product users should check out <a href="http://secunia.com/advisories/25047/">this latest issue</a> Secunia has released today - a problem with the htmlentities and htmlspecialchars functions that can lead to buffer overflows.
</p>
<blockquote>
<p>
The vulnerabilities are caused due to boundary errors within the "htmlentities()" and "htmlspecialchars()" functions. If a PHP application uses these functions to process user-supplied input, this can be exploited to cause a heap-based buffer overflow by passing specially crafted data to the affected application.
</p>
<p>
Successful exploitation may allow execution of arbitrary code, but requires that the UTF-8 character set is selected.
</p>
</blockquote>
<p>
Products affected include the Network Analysis Modules (NAM) for Cisco 6500 switch, Cisco 7600 router/Branch Routers and the CiscoWorks Wireless LAN Solution Engine (WLSE) and CiscoWorks Wireless LAN Solution (among others, check out <a href="http://secunia.com/advisories/25047/">the advisory</a> for a more complete list). 
</p>
<p>
There are some patches that have been released to correct this issue (like the one for the Cisco Unified Application Environment) but others are still yet to come. They recommend limiting access to only trusted IPs and devices only to reduce the risk of the problem being exploited.
</p>]]></description>
      <pubDate>Thu, 26 Apr 2007 07:55:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoyan Stefanov's Blog: Performance tunning with PEAR::DB]]></title>
      <guid>http://www.phpdeveloper.org/news/7108</guid>
      <link>http://www.phpdeveloper.org/news/7108</link>
      <description><![CDATA[<p>
<i>Stoyan Stefanov</i> has <a href="http://www.phpied.com/performance-tunning-with-peardb/">posted some of his tips</a> to his blog today. Specifically, they deal with the PEAR::DB class, demonstrating some of the optimization of the package he's discovered in his coding experience.
</p>
<blockquote>
If you use <a href="http://pear.php.net/package/MDB2/">PEAR::MDB2</a>, you can set a custom debug handler and collect all the queries you execute for debugging and performance tunning purposes, <a href="http://www.phpied.com/performance-tuning-with-mdb2/">as shown before</a>. But what if you're using <a href="http://pear.php.net/package/DB/">PEAR::DB</a>? Well, since PEAR::DB doesn't allow you such a functionality out of the box, you can hack it a bit to get similar results.
</blockquote>
<p>
He <a href="http://www.phpied.com/performance-tunning-with-peardb/">creates a simple app</a> to help with the illustration - a number of select queries to grab zipcode information from the database. As it stands, the PEAR::DB package doesn't handle the debugging well, so he adds in a few more lines to buffer the connection and some reporting code to check the resulting output (as well as some of his sample reports).
</p>]]></description>
      <pubDate>Wed, 17 Jan 2007 09:35:00 -0600</pubDate>
    </item>
  </channel>
</rss>
