php

Restarting Apache Gracefully

apache

If you are restarting the web server on a live website, you should do it gracefully. A graceful restart tells the web sever to finish any active connections before restarting. This means that active visitors to your site will be able to finish downloading anything already in progress before the server restarts. If you are [...]

Read the full article →

How to Upgrade APC on Ubunutu

apache

APC — the Alternative PHP Cache — is a handy caching utility for use with PHP. We use it with W3 Total Cache to speed up our WordPress sites. I recently had a little trouble remembering how to upgrade APC to a more current version on our Ubuntu installations. We had installed APC with pecl, [...]

Read the full article →

PHP APC: How to Monitor Usage and Config for Optimum Performance

apache

APC is the Alternative PHP Cache. It’s a handy caching utility for use with PHP. We use it with W3 Total Cache on our WordPress installations. It runs OK “out of the box.” But you likely need to tune the config a bit to get the most out of it. The most common tweak is [...]

Read the full article →

How to view and debug PHP arrays

debug

Sometimes when coding or debugging in PHP, it’s helpful to see the entire contents of an array. An easy way to do this is with the print_r command. To make it more readable, wrap it in <pre> tags. For example, to see the contents of associative array $FormData: You’ll see output like this: Array ( [...]

Read the full article →

How to install PHP GD2 library on Ubuntu

php

I needed to install the PHP GD2 library to support the WordPress captcha plugin SI CAPTCHA Anti-Spam.  I found the right library and installed it with this apt-get command: But SI CAPTCHA Anti-Spam test page still said GD Support: No.  The fix?  I had to restart apache: I tried the SI CAPTCHA Anti-Spam test again, [...]

Read the full article →