PHP

Stop MySQL giving up on Drupal

With Drupal, if you have a content type with lots of records you can run into a problem where you start getting lots of "server has gone away" errors from MySQL. This stems from queries getting too long and MySQL giving up before the query has finished loading. So, to fix it, just edit your my.ini or my.cnf file to add the following line to the [mysqld] section:

  • max_allowed_packet=24M

There are other settings that can make a difference too, but this seems to be a good starting point.

Tags: 

One solution for "unexpected T_SR" errors in PHP

Here's a little tidbit. If you ever get "Parse error: syntax error, unexpected T_SR" errors in PHP, check to see if you had any svn merge conflicts. This error raised its ugle head this evening for me and that's exactly what it turned out to be. Then just bounce over to your svn client of choice, fix the conflict (or just delete the offending files and grab the latest file again), and the error will disappear.

Tags: 

Key Drupal 5 concept - boxes are not automatic

A key feature in Drupal is being able to create plugins/modules that create their own blocks, chunks of functionality that can be placed anywhere on the page by using the blocks/regions configuration or panels. If you do happen to create your own, bear in mind that while you automatically gain the features of the mail blocks table, you do not gain access to the boxes table, so you have to create your own body content block. Just thought you should know. And yes, this fact has just dawned on me. Doh.

Tags: 

Why does PHP still suck on OSX?

I'm a little puzzled and frustrated with Apple.

With Macs, or more specifically OSX, becoming the platform of choice for web developers world over, why do they still insist in neutering our capabilities by bundling limited versions of the most common web development tools rather than all or nothing? With Leopard they at least improved the Ruby install to the point it was useful (you could actually now run Rails without having to compile from source) but PHP is missing so much functionality through the lack of pear and shared libraries to make it a pain to use.

Tags: 

Pages

Subscribe to PHP