php

The Drupal Diaries, Day 10

Wow, it's taking an awful lot of work trying to keep this site running right now. The server we're currently running on is a virtual CentOS machine with 256MB RAM, and the constant traffic from both users and robots (crawlers) causes Apache to lock up from time to time. Right now I'm tweaking all the LAMP (Linux, Apache, MySQL, and PHP) knobs I know how to tweak to keep the site more or less running most of the day.

Here's a quick review of the hacks, er, performance optimizations, I've been working on.

The PHP "headers already sent" error message

Still in my early days working with PHP, I've learned that it's really easy to generate the dreaded "headers already sent" error message. If for some reason you actually want to generate this error message intentionally, I've learned that all you have to do is try to send HTML body content (any non-header content) before calling the header() or setcookie() methods, and you'll get that PHP error message right away.

PHP redirect - How to send a redirect with PHP

PHP redirection FAQ: How can I redirect a user in a PHP script?

I've been working with OpenSSO a lot lately (Sun's open source identity management product), and one thing you see right away is that they redirect the user's browser a lot during the login process. During a typical login process a user will attempt to access a protected page; an OpenSSO agent will redirect the user's browser to the OpenSSO login page; and after a successful login they redirect you back to the protected resource.

Syndicate content