PHP

PHP Notice: Undefined variable: _SERVER in ..

I upgraded Linux on this server a while back and in the course of that upgrade PHP was upgraded too, to version 5.5.9. Since I had a modified php.ini it asked me to check over any new options. There were a few but I fixed anything that looked like it […]

PHP

PHP is_numeric() vs is_int()

Some lessons you don’t forget, but this one I did because it doesn’t come up very often. Don’t use is_int() because, as Jeremy says, it’ll lie to you. Use is_numeric() instead. Copy the following chunk of code into a php file and run it. You’ll be surprised at the outcome: […]

PHP

No activity within 1800 seconds; please log in again

1800 seconds is such a long time, right? It’s 30 minutes. It’s 0.5 hours. It’s 0.0208333333 days. It’s also 5.70397764 × 10-5 years. And it’s not long enough for me. phpMyAdmin logs you out after 1800 seconds, obviously for security reasons. That’s fine if there are other people about, if […]

PHP , WordPress

Is your eAccelerator cache dir still there?

While looking through this WordPress performance post I realised that eAccelerator might not be running properly on this blog. For some time I’ve noticed this site hasn’t been as quick off the mark as it used to be. Dare I say it, but it was even a little sluggish! If […]

apache , PHP , WordPress

Notes when upgrading to PHP5

I upgraded one of my servers to PHP5 this morning. Two things to watch out for: The location of your php.ini may have changed. It’s probably now in /etc/php5/apache2/. You need to copy over any changes from your old one. Update your libraries too such as the mysql client and […]

PHP , WordPress

Killing off PHP

Do you know why Apache processes get stuck and stop responding when serving pages on a WordPress site? I’ve seen this happen here and on my previous host on a regular basis. I don’t know what happens. It can’t be a PHP script gone into an infinite loop because the […]

apache , PHP , Web

Gzip Compression or No?

mod_gzip, zlib.output_compression or whatever way you compress your web pages is a great way of reducing your network traffic costs but comes at the cost of increased CPU usage. Despite what you might think, it can be more expensive to send data over the network, especially to slow clients than […]

PHP

Five common PHP design patterns

Over at IBM Developer Works there's an interesting article on PHP patterns. If you've never come across patterns before it's a good introduction. Just remember that these methods of solving software problems are most useful when you've got lots of code. Using the MVC pattern to print "Hello World!" is […]

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close