PHP Error Class ‘SoapClient’ not found

I’ve often found that something gets left out or forgotten when moving a website from an old server to a new install. I’ve just finished migrating one of my customer’s sites to a new CentOS 5.0 install with Apache 2.2 and PHP 5.1.6, and there’s one single PHP script in the site which uses the SoapClient class.

Naturally I’d forgotten to test this particular function until after the migration was complete, and was wondering why the script had failed. A quick look in the Apache error log file revealed the following error message: PHP Fatal error: "Class ‘SoapClient’ not found"

Installing AWStats on CentOS

AWStats provides a useful overview of website statistics from your Apache log files. There is no automatic way to install AWStats on CentOS using yum, so this article looks at how to install AWStats on CentOS. The instructions below should also work on other Linux distributions that do not have an automatic way of installing AWStats.

Use of www in website addresses

Tim Berners-Lee is the creator of the "World Wide Web" and the www prefix used in so many website addresses was his "fault" 🙂 It made sense at the time to have a different prefix for domains for different services such as ftp, email, websites and more. However, websites came to use both the www and non-www prefix for accessing them (eg www.example.com and example.com) and the www part has therefore become somewhat redundant.

This article looks at why I use the www version of the domain name as the primary domain name for my websites, and redirect traffic from the non-www version to the www version.

Compressing files on Apache with mod_deflate

It’s possible with the Apache web server to compress files that are sent to the browser so less bandwidth is consumed and the load time should generally be faster. The module in Apache 2.0 and up is called mod_deflate.

Apache – Permission denied: Failed to acquire SSL session cache lock

I’ve set up a CentOS 5 Apache web server for a customer where we run the web server as user different from the default user "apache" (often "nobody" is used as well). The application runs through SSL using mod_ssl, and when accessing SSL secured pages errors like these would appear in the error log:

"[Wed Nov 14 11:16:49 2007] [warn] (13)Permission denied: Failed to acquire SSL session cache lock
[Wed Nov 14 11:16:49 2007] [warn] (13)Permission denied: Failed to release SSL session cache lock"

Changing Apache log rotation behaviour on CentOS / RHEL

On a default install of CentOS or Red Hat Enterprise Linux, the log rotation script will automatically rotate the Apache log file each day and then reload the httpd service. This post looks at how to prevent this action from occuring automatically, or to change the behaviour to rotate the log files if your naming convention for log files is different from the default.