<?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>Mon, 08 Sep 2008 03:36:50 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Toomas Romer's Blog: Case study: Is PHP embarrassingly slower than Java?]]></title>
      <guid>http://www.phpdeveloper.org/news/10755</guid>
      <link>http://www.phpdeveloper.org/news/10755</link>
      <description><![CDATA[<p>
In a <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">case study</a> posted to his blog, <i>Toomas Romer</i> wonders if a PHP script is embarrassingly slower than than its Java counterpart.
</p>
<blockquote>
The problem. The PHP implementation [of the <a href="http://firestats.cc/wiki/ip2c">IP2C library</a>] is a lot slower. Embarrassingly slower. Without any caching the Java version is able to do ~6000 queries per second. The PHP counterpart can push through ~850 queries. The implementations are the same. The stats provided by the author of the library are 8000 vs 1200. So about the same as my measurements.
</blockquote>
<p>
He details the script, showing <a href="http://dow.ngra.de/wp-content/uploads/2008/08/vanilla1.png">what parts</a> the script is taking up the most time on. A large part of the execution is tied up in IO and the fseek/fread and readShort/readInt functions take up a good chunk. 
</p>
<p>
He even tries removing the functions and making things a bit more streamlined. This helps, but still lags behind its Java brother. Check out <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">the post</a> for more statistics comparing the two.
</p>]]></description>
      <pubDate>Mon, 04 Aug 2008 12:02:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gareth Heyes' Blog: Faking the unexpected]]></title>
      <guid>http://www.phpdeveloper.org/news/9167</guid>
      <link>http://www.phpdeveloper.org/news/9167</link>
      <description><![CDATA[<p>
<i>Gareth Heyes</i> has <a href="http://www.thespanner.co.uk/2007/12/02/faking-the-unexpected/">an example</a> of yet another way he's seen developers incorrectly handle incoming connections and the information inside. This time, he focuses on the remote IP coming from the client.
</p>
<blockquote>
Developers place too much trust in everything, they assume that certain data cannot be faked and therefore these pieces of data can be used as a Trojan horse. Lets take the REMOTE IP of a user, it seems a trusted source because of the TCP/IP connection between the user and the server.
</blockquote>
<p>
He points out the difference between HTTP_X_FORWARDED_FOR and REMOTE_ADDR and how, despite them being the same almost all of the time, shouldn't be trusted since they could be spoofed. He even includes an example script showing how it could be done (and how a bit of Javascript can even be inserted).
</p>]]></description>
      <pubDate>Tue, 04 Dec 2007 08:36:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: Wrong PHP prediction: you don't need to patch PHP to run multiple versions]]></title>
      <guid>http://www.phpdeveloper.org/news/8625</guid>
      <link>http://www.phpdeveloper.org/news/8625</link>
      <description><![CDATA[<p>
In a <a href="http://blog.adaniels.nl/?p=48">new post</a> today, <i>Arnold Daniels</i> has posted about (and linked to) a few methods for running PHP4 and PHP5 on the same server at the same time - running them as CGIs.
</p>
<blockquote>
You simply can't have PHP4 and PHP5 both run as Apache2 module in the same process, because they use a lot of the same internal symbols (variables, function names, etc). If you would change that, nobody would be able to write any extensions which run both on PHP4 and PHP5. However you can run multiple PHP versions as CGI modules and there is no patch required for that.
</blockquote>
<p>
He points out <a href="http://gggeek.altervista.org/2007/07/21/running-multiple-php-versions-on-a-single-apache-install/">an article</a> from <i>Giunta Gaetanos</i> that handles it similarly, but requires the filename to match a certain pattern to determine which to use. He suggests a slightly different alternative, namely using different IPs for PHP4 vs PHP5 and use DNS to route the domains to the right locations.
</p>]]></description>
      <pubDate>Mon, 10 Sep 2007 16:55:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Tracking Website Statistics with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/6250</guid>
      <link>http://www.phpdeveloper.org/news/6250</link>
      <description><![CDATA[<p>
As any developer will tell you, putting a website out on the internet is only half of the equation. The other half is trying to figure out some of the visitors (and how many of them) coming to your site. That's where <a href="http://www.devshed.com/c/a/PHP/Tracking-Website-Statistics-with-PHP/">this new article</a> from DevShed comes in.
</p>
<blockquote>
If you have a website, especially one that sells products or services, it can be useful to track the visitors to your site. This article explains how to write a program that will do just that.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Tracking-Website-Statistics-with-PHP/">offer a database-based suggestion</a> for recording various pieces of visitor information, including: IP address, date/time of the visit, pages viewed, browser type, and the referring page. They give the database structure and the PHP code needed to push the data into it. They also include some simple analysis code/SQL to show the different habits of your visitors and place them into an easy-to-read dynamic HTML page.
</p>]]></description>
      <pubDate>Tue, 12 Sep 2006 08:16:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Nexen.net: PHP Statistics for July 2006]]></title>
      <guid>http://www.phpdeveloper.org/news/5957</guid>
      <link>http://www.phpdeveloper.org/news/5957</link>
      <description><![CDATA[<p>
<i>Damien Seguy</i> has submitted information about the <a href="http://www.nexen.net/chiffres_cles/phpversion/php_statistics_for_july_2006.php">latest PHP statistics</a> for this month for July 2006:
</p>
<blockquote>
<p>
Here are the PHP stats for July 2006. To learn about methodology, read la section phpversion. 15 millions servers were surveyed during May, and 8,1 millions were used for stats: domaines without web sites, those unreachable, ISP or domain parkings were not considered.
</p>
<p>
In brief : 
<ul>
<li>PHP 5 keep on growing, but slower
<li>PHP 5.1.4 is now the most popular PHP 5 version
<li>PHP 4.4.2 is bigger than ever
<li>New : PHP adoption by governements around the world
</ul>
</p>
</blockquote>
<p>
For each of the stats, there's a <a href="http://www.nexen.net/chiffres_cles/phpversion/php_statistics_for_july_2006.php">nice graph</a> of various types to show the distribution and information (such as maps for the spread of PHP's market share all across the world).
</p>]]></description>
      <pubDate>Fri, 04 Aug 2006 11:39:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMac.com: IP Banning]]></title>
      <guid>http://www.phpdeveloper.org/news/4937</guid>
      <link>http://www.phpdeveloper.org/news/4937</link>
      <description><![CDATA[PHPMac.com has posted <a href="http://phpmac.com/articles.php?view=248">a quick tutorial</a> on how to "ban an IP" from your site.
<p>
<quote>
<i>
Blocking certain IP addresses from your site is actually much easier than you might think.
<p>
In fact, it is only a seven-line code inserted at the top of your page!
</i>
</quote>
<p>
<a href="http://phpmac.com/articles.php?view=248">The code</a> basically just looks in an array of IP values and checks to see if the remote user's matches any of them. If it does, it echos out an error and stops the page execution. Obviously, this is just a basic example, and could be enhanced with a databse table that would be easier to manage than just the static array.]]></description>
      <pubDate>Mon, 06 Mar 2006 07:18:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPit.net: Creating a "Who's Online" script with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/4490</guid>
      <link>http://www.phpdeveloper.org/news/4490</link>
      <description><![CDATA[New from PHPit.net today, there's <a href="http://www.phpit.net/article/creating-whosonline-script-php/">this tutorial</a> on the creation of a "who's online" script with PHP.
<p>
<quote>
<i>
In this tutorial I will show you how to create your own "Who's Online" script, which is often found on message boards and other community scripts. We will first create a really simple script, and after that add a few more features like the location of each visitor. But first, let me explain how our "Who's Online" script is going to work.
</i>
</quote>
<p>
<a href="http://www.phpit.net/article/creating-whosonline-script-php/">The script</a> stores an IP and a timestamp in the database, and will keep note of their last page request. After a bit, when they are no longer making requests, it will remove them from the list. The little trick behind it is a "web bug" - a small script that actually runs as a small PHP-created image...]]></description>
      <pubDate>Mon, 12 Dec 2005 15:00:05 -0600</pubDate>
    </item>
  </channel>
</rss>
