<?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>Thu, 23 May 2013 14:56:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: PHP Sessions]]></title>
      <guid>http://www.phpdeveloper.org/news/17141</guid>
      <link>http://www.phpdeveloper.org/news/17141</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a <a href="http://phpmaster.com/php-sessions/">new introductory tutorial</a> for those trying to figure out sessions in PHP. Sessions can be one of the most powerful tools at your disposal and handling them correctly can sometimes be a little tricky.
</p>
<blockquote>
$_SESSION is a special array used to store information across the page requests a user makes during his visit to your website or web application. The most fundamental way to explain what a sessions is like is to imagine the following scenario: You are working with an application. You open it, make some changes, and then you close it. That is a session in it's simplest form.
</blockquote>
<p>
They start with a basic "how to use them" example of setting a username value to the current session and pulling the value back out. They also show the use of the <a href="http://php.net/session_unset">session_unset</a> and <a href="http://php.net/session_destroy">session_destroy</a> methods for ending the session. Some security tips are mentioned too - timeouts, regenerating the session ID, destroying them correctly and using a more permanent storage option (by default, they store on the local disk).
</p>]]></description>
      <pubDate>Thu, 17 Nov 2011 10:19:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[FinalConcept.com.au: Symfony: Session Login Timeout]]></title>
      <guid>http://www.phpdeveloper.org/news/14751</guid>
      <link>http://www.phpdeveloper.org/news/14751</link>
      <description><![CDATA[<p>
On the FinalConcept.com.au blog there's <a href="http://www.finalconcept.com.au/article/view/symfony-session-login-timeout">a new post</a> from <i>Adam Pullen</i> showing how to solve a common issue with user logins and timeouts in Symfony applications (especially those using something like sfGuard).
</p>
<blockquote>
Symfony uses the PHP session management sub-system to store tempoary user specific data. When using the sfDoctrineGuardPlugin, or any other application guard, the timeout and lastRequest data are stored. [...] Since PHP has no clue of Symfony it will happily delete all session files that are older than the gc_maxlifetime value. This causes Symfony to logout the user. The user then has to login again. For all "day long apps" that are only used periodically (like time tracking software) this can cause some greif for the user.
</blockquote>
<p>
His solution is to change the gc_maxlifetime setting in your php.ini file (or just the ini settings) to something higher than what Symfony will use. This can be done directly in your application too by defining the ini value on the fly in your factories.yml config file.
</p>]]></description>
      <pubDate>Tue, 06 Jul 2010 12:11:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Don Raman's Blog: Troubleshoot - My PHP script is timing out]]></title>
      <guid>http://www.phpdeveloper.org/news/13993</guid>
      <link>http://www.phpdeveloper.org/news/13993</link>
      <description><![CDATA[<p>
In a recent post to his IIS.net blog <i>Don Raman</i> wants to help out all of those <a href="http://blogs.iis.net/donraman/archive/2010/02/08/troubleshoot-my-php-script-is-timing-out.aspx">developers getting timeout messages</a> on their PHP scripts running on a Windows platform and how some FastCGI settings could help.
</p>
<blockquote>
Let's try to understand the reason behind this. [...] Let me now summarize some of the IIS FastCGI settings and PHP INI configuration directive to ensure that everyone is on the same page and which are most important for this discussion.
</blockquote>
<p>
The two FastCGI settings he mentions are the ActivityTimeout and the RequestTimeout as well as a generic PHP setting that could be a cause of the problem, max_execution_time. He suggests some default values for each of these, but only experimentation will help you find the right balance of these three. It's a great starting place to look, though - especially if you've been battling the problem for a while.
</p>]]></description>
      <pubDate>Tue, 09 Feb 2010 12:03:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Vinu Thomas' Blog: Fixing the "Missed Schedule" problem in Wordpress]]></title>
      <guid>http://www.phpdeveloper.org/news/13758</guid>
      <link>http://www.phpdeveloper.org/news/13758</link>
      <description><![CDATA[<p>
<i>Vinu Thomas</i> has <a href="http://blogs.vinuthomas.com/2009/12/31/fixing-the-missed-schedule-problem-in-wordpress">posted a tip</a> for WordPress users working with scheduled posts and the "Missing Status" status that's caused by a bug in WordPress.
</p>
<blockquote>
Ever since the upgrade to Wordpress 2.9, I've been having a problem in the scheduled posts in Wordpress. Everytime I set a post to be scheduled in the future, it used to miss the scheduled time and never get posted. When I checked the status of these posts in the posts admin area, each of these posts had the status "Missed Schedule" next to them.
</blockquote>
<p>
To correct the issue, you need to make a change to the cron.php script for your installation (in wp-includes) to change the default timeout by quite a bit to ensure that the remote call has plenty of time to finish. It seems its related to the version of PHP's curl extension that's compiled into the web server installation.
</p>]]></description>
      <pubDate>Thu, 31 Dec 2009 13:13:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Alison Lunde's Blog: Quick and Dirty PHP Caching]]></title>
      <guid>http://www.phpdeveloper.org/news/12236</guid>
      <link>http://www.phpdeveloper.org/news/12236</link>
      <description><![CDATA[<p>
<i>Alison</i> has <a href="http://www.snipe.net/2009/03/quick-and-dirty-php-caching/">posted a guide</a> to a technique that can help your site resist higher loads - content caching:
</p>
<blockquote>
Caching your database-driven website pages has a plethora of benefits, not the least of which being improved speed and reduced server loads. This article will explain how to set up a simple caching system, and will also address when and where caching might not be appropriate.
</blockquote>
<p>
She shares her "six lines of glory" that cache the resulting HTML page (after all data has been pulled from the database and rendered) into a cached file with output buffering. On other side of things, there's another script that, based on the page requested, checks to see if a cached file exists. She also modifies it slightly to include a timestamp so things aren't just cached forever. 
</p>
<p>
There's also a recommendation in the comments of the post to use the <a href="http://us2.php.net/apc">APC caching extension</a> that's already built. Of course, this can only really be used if you have access to install it on the remote machine (not an option on things like shared hosting).
</p>]]></description>
      <pubDate>Mon, 30 Mar 2009 12:56:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Juozas Kaziukenas' Blog:  Prevent scripts from being killed]]></title>
      <guid>http://www.phpdeveloper.org/news/12216</guid>
      <link>http://www.phpdeveloper.org/news/12216</link>
      <description><![CDATA[<p>
<i>Juozas Kaziukenas</i> has <a href="http://dev.juokaz.com/php/prevent-scripts-from-being-killed">a helpful tip</a> you can use on those long-running scripts to keep going - the <a href="http://php.net/set_time_limit">set_time_limit</a> function.
</p>
<blockquote>
I have some very time consuming scripts running through <a href="http://en.wikipedia.org/wiki/Cron">CRON</a> - some nice web scrapping jobs. They are not processing-intense, but rather slow because of slow websites. All these jobs are really hard to divide in to separate scripts (another article), so one script should have no limits to run for hours. However, web servers don't like it by default.
</blockquote>
<p>
He show how you can use the set_time_limit function to free your script of the timeout limitation (which can be a good and bad thing) or having your script output something, like a "processing" message, as it runs through the loop to keep the timeout away. You can also use the <a href="http://php.net/ignore_user_abort">ignore_user_abort</a> function to continue the process even if the user hits the stop button or otherwise closes the request.
</p>]]></description>
      <pubDate>Thu, 26 Mar 2009 13:18:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: PHP's MySQL connection timeout]]></title>
      <guid>http://www.phpdeveloper.org/news/9419</guid>
      <link>http://www.phpdeveloper.org/news/9419</link>
      <description><![CDATA[<p>
In the process of debugging one of his scripts, <i>Brian Moon</i> came across a default setting (and problem) in the MySQL extension that didn't seem to <a href="http://doughboy.wordpress.com/2008/01/13/phps-mysql-connection-timeout/">make much sense to him</a>:
</p>
<blockquote>
There are several reasons that PHP could not be able to connect to MySQL. [...] Or, perhaps the entire server is offline.
</blockquote>
<p>
The mysql.connect_timeout setting in the php.ini is supposed to handle this sort of instance, but the default is set tpo 60 seconds. It's only apparently used when the server is completely offline and, in his opinion, is set way too high. He's proposing a patch to the MySQL extension to change this setting's default to shorten it to something a bit more reasonable.
</p>]]></description>
      <pubDate>Mon, 14 Jan 2008 12:59:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jaanus' Blog: How to retrieve remote files in your web apps and still be friends with the server]]></title>
      <guid>http://www.phpdeveloper.org/news/4684</guid>
      <link>http://www.phpdeveloper.org/news/4684</link>
      <description><![CDATA[In <a href="http://www.jaanuskase.com/en/2006/01/how_to_retrieve_remote_files_i.html">this post</a> on <i>Jaanus'</i> blog today, they show how you can grab remote files from a server and still "remain friends" with the server.
<p>
<quote>
<i>
It often happens that when you're building a web page or app, you may want to include some content from a remote server. Say that it's some statistic figure that the remote outputs as HTML or TXT and you then want to retrieve it and either do something with it or directly display as part of your own page. And you're working in PHP.
<p>
PHP provides a fancy way of opening and including files directly over HTTP, which they call "<a href="http://ee.php.net/manual/en/features.remote-files.php">URL wrappers</a>". As tempting as it may seem, in the long run doing remote opens with URL wrappers is not the best practice. So here's what I came up with when needing to do this kind of caching thing in my own scenarios. It requires you have the cURL module installed and that the webserver can read and write from /tmp.
</i>
</quote>
<p>
They <a href="http://www.jaanuskase.com/en/2006/01/how_to_retrieve_remote_files_i.html">provide the short script</a> that does the work inside a function (easy to drop into a class), and grabs the remote file, and pulls down to /tmp for the script to use. It even allows you to specify a timeout for the file, forcing the script to grab a new copy every so often...]]></description>
      <pubDate>Wed, 18 Jan 2006 07:19:36 -0600</pubDate>
    </item>
  </channel>
</rss>
