10 November, 2008
Practical use of message queues
I stumbled on this post over at the flickr developers blog while chatting with Jo about web applications designed and built for "the cloud". An article earlier this week piqued my curiosity about message queues, and got me thinking about how they can be used to move processing tasks out of the way. I'd known already that minimizing those tasks within, let's say, a PHP script that builds a page can help your application scale or seem more responsive.
To do so, I've relied on cron jobs, but the main problem with that approach is either that your cron job runs when it has nothing to do, if you run it too frequently, or it has too much to do and you run the risk of one job starting while another is in progress and working with potentially the same data.
...click to continue reading.18 August, 2008
Thinking of switch to PHP w/Fast CGI?
If you're contemplating switching to running PHP5 under FastCGI, to take advantage of apache's threaded worker model and improve your server's performance, think again. If you're used to setting and overriding php values via .htaccess files or using php_value/php_flag in your virtual host directory, this is not supported with FastCGI. You'll have to figure out how to set those values via some other means. Some PHP ini directives can be set in your script directly, with ini_set, but others have to be set outside of it (register_globals for example).
...click to continue reading.13 August, 2008
Troubleshooting connection problems with memcached
I was noticing today many apache segfaults on this server, and pretty high traffic loads at times. I haven't pinpointed the exact cause of high traffic, there are a couple candidates, but the apache segfaults seem to accompanied by the following PHP errors:
...click to continue reading.22 February, 2008
Using OpenId for Authentication
Cal Evans wrote a straightforward and excellent tutorial on how to to use Zend_Auth and its OpenID adapter to authenticate users today.
...click to continue reading.16 November, 2007
A comprehensive look at PHP5 DateTime
Don't expect to find it here, but Laughine Meme posted the most comprehensive one I could find. You would think that with the introduction in 5.
...click to continue reading.28 August, 2007
Don't abuse PHP's header function for redirects
PHP's Header function can come in quite handy when you're building your next greate web application. Its powerful, but as a result, its tempting to misuse it to do even the simplest things, like permanent redirects. Usually, its done like this:
// redirect /publications (this page) to real page (/documents)
Header("Location: /documents/");
One line of code, time to move on to the next task in your queue, right?
...click to continue reading.3 May, 2007
Familiar PHP session poll
Hmm, why does this poll look so familiar? Oh yeah, the options to vote on are word for word the same as my post on
...click to continue reading.13 March, 2007
Avoiding frustration with PHP Sessions
PHP's support for sessions make adding "state" to your web application super easy. Bus because the illusion of state is maintained by storing a Session ID via a user's cookies, you might find yourself losing potentially productive hours chasing down bizarre client side bugs or opening up a potential security hole.
...click to continue reading.3 October, 2006
Anti-Comment Spam recommendation: Akismet
comment spam that had been getting by mod_security and my other measures. It literally took me 15
minutes to install, thanks to the libraries already
available for it. ...click to continue reading.
22 September, 2006
Debian, PHP5, and session garbage collection
Poking around, like you do on your server, I noticed that php session files weren't being deleted, even after a few days. Turns out, PHP's automatic garbase collection is disabled on Debian. Instead, its replaced by a cron script that cleans out the /var/lib/php5 directory, which is where sessions are saved by default.
...click to continue reading.












