PHP

PHP is a programming language popular for use with web applications. http://php.net

Drupal 7

The latest major release of Drupal 7.0 feels like a long-time coming. I was not one of those followers that was overly optimistic thinking it would have been released in 2009... they were crazy to think that. The overall changes seem well made and a natural progression of the Drupal platform. Since version 5.0 each release has been not just a cool update but something more of literal stepping stones where going back seemed archaic. The changes in Drupal 7.0 will help new users and old.

Tags: Drupal, PHP

PHP performance optimization and tuning tips

4
Your rating: None Average: 4 (1 vote)

In my work PHP is a required part of most, if not all web sites I help with; especially Drupal. Here are tips I've collected along the way and of course YMMV (your mileage may vary).

PHP Tuning

  • Utilize Op-code caching like APC, eAccelerator, Xcache, or Zend Accelerator. APC is my favorite and has been reported as the most stable and has good performance.
  • Run PHP in FastCGI (FCGI) mode versus regular CGI methods, if possible. FCGI uses a socket to the PHP process, not forking.
  • Disable PHP extensions not needed.
  • Disable debug/development extensions on production & staging servers.

APC (Alternative PHP Cache)

The Alternative PHP Cache (APC) is a free and open op-code cache for PHP. The behavior of these functions is affected by settings in php.ini. The bundled apc.php script provides a detailed analysis of how APC is working.

  • Increase apc.shm_size higher than the default 30MB. Drupal sites use 64MB or higher; 96MB is usually good enough.
  • Increase apc.num_files_hint 1024 works for Drupal, some sites may need higher than the default 1000 and can go up to 20000. Start small first.
  • Increase apc.user_entries_hint the default 4096 can be enough, this is another that can go up to 20000 if ncessary.
  • Enable apc.enable_cli to help speed up PHP scripts that run via the command line.
  • Enabling apc.include_once_override speeds scripts up but be warned: updated and new files will not be cached until APC is flushed.
  • Enabling apc.rfc1867 provides upload progress data to PHP, giving better user experiences on web pages during large file uploads.
  • Leave apc.max_file_size at the default 1MB.
  • Carefully use apc.filters to exclude file extensions that should not be cached by APC.
  • Disabling apc.stat will boost speed but new/updated files will not be recognized unless APC cache is rebuilt. Do not try this for fun; advanced use only.

Tags: PHP

Speaking at the Adobe MAX 2010 conference

I was invited for the third year in a row to present at the large Adobe MAX conference this October. It will be taking place in Los Angeles again, which works out great for me. Instead of a regular speaking session I will be instructing two hands-on labs, both about building Drupal themes (basics and advanced theme production).

Adobe MAX 2010 conference details area available at: http://max.adobe.com

Tags: Drupal, PHP, CSS, HTML

New Drush plug-in for Drupal developers

My new Drupal related project, an add-on for Drush called "Drush Cleanup" is now online. It helps developers by cleaning out all the text files that are not needed when running a Drupal site (like README.txt). The project files and details are available at: http://drupal.org/project/drush_cleanup

Tags: Drupal, PHP, Drush

Presentation: Changes to Drupal 7 Themes (part 1)

At a recent LA Drupal meetup I presented on the changes to Drupal themes in D7. The slides are available for download at http://www.slideshare.net/ccharlton/changes-to-drupal-themes-in-version-...

Tags: Drupal, PHP, CSS, JavaScript, jQuery

Microsoft sponsoring Drupal 7

The game is changing again. Microsoft who originally was supporting Drupal by promoting it is now funding Drupal development. Their contribution to Drupal 7 will be a native Microsoft SQL Server driver was announced at DrupalCon 2010 in San Francisco. This will let customers have a Microsoft alternative to MySQL or Postgre. I applaud this initiative.

Tags: Drupal, PHP

Drupal: Creating and Editing Custom Themes on Lynda.com

I am now a Lynda.com author. My first video title "Drupal: Creating and Editing Custom Themes" is out now and is an online exclusive. The course teaches the basics of Drupal themes - what they are, how to control them, and how to build your own theme from scratch. The course is a little over 4 hours long, so you should be able to complete the course in a day or less.

Watch how to theme Drupal online now at http://tinyurl.com/theme-drupal

Drupal tutorials

Tags: Drupal, PHP, CSS

Microsoft supports Drupal

This is a big one. Microsoft is now supporting Drupal (and Wordpress, no Joomla it seems). They offer PHP web app downloads to promote the fact that Windows Server now ships with PHP support, certified by Microsoft and Zend. Drupal is at the top of the lists. This is big.

I manage the Los Angeles Drupal user group and each year we throw a free DrupalCamp in or near Los Angeles. One of our key sponsors this year is Microsoft and they were great about it and ended saying a lot at the camp about their support for PHP & Drupal.

Tags: Drupal, PHP

Speaking at Adobe MAX 2009

I will be presenting at the Adobe MAX 2009 conference in Los Angeles. My two sessions will be about designing with Drupal using Adobe Dreamweaver.

Adobe MAX 2009 takes place in October at the Los Angeles Convention Center. http://max.adobe.com

Tags: Drupal, PHP

PHP 5.3

The release of PHP 5.3 comes to me with mixed feelings. On one hand I love keeping software up-to-date. On the other, more important hand, there are some major changes that are for the better of PHP but do not work with my CMS platform of choice - Drupal. At this time Drupal 6 is still only compatible with PHP 5.2 and while I'm optimistic I feel there is not a rush to upgrade.

Tags: PHP

Speaking at Adobe MAX 2008 on Extending Dreamweaver

The Adobe Dreamweaver team has taken notice of my many extensions. In particular my jQuery and Drupal extensions. I have been invited to present a session on Extending PHP in Dreamweaver, where I will go over basics of creating and sharing a PHP Server Behavior extension for Dreamweaver.

Adobe MAX 2008 takes place in October at the Moscone Center in San Francisco. http://max.adobe.com

Tags: PHP, JavaScript, jQuery

Drupal 6

I'm glad to see the release of Drupal 6. If you haven't heard of Drupal it is a free, open source content management system (CMS) written in PHP. One minor downfall of this release is the backwards compatibility of PHP so it is written to support PHP4 but that doesn't mean your modules could not make PHP5 a requirement to run.

Drupal 5 has thousands of web sites running, and Drupal 4.x has probably even more legacy sites still floating around. I'm sure Drupal 6 will take over as soon as more modules are available for it.

Tags: Drupal, PHP

Speaking at DrupalCon 2008 in Boston: Better Drupal Interaction Design with Flex

I am presenting on Better Drupal Interaction Design with Flex at DrupalCon Boston this March. I was invited to speak by the conference organizers and Adobe. So, thank you to all involved.

UPDATE: My presentation slides are available online for download at http://www.slideshare.net/ccharlton/better-drupal-interaction-design-wit...

Tags: Drupal, PHP

Drupal 5

The release of Drupal 5 on the surface surpassed the previous version (4.7) by far. When I was first introduced to Drupal around version 4.6 it really peaked my interest in the project as I was already familiar with frameworks, open source, and of course had my own web site template schemes with code I was painfully maintaining across multiple clients. I made a simple client control panel with PHP & MySQL just to track sites and their versions.

Tags: Drupal, PHP

PHP 5.2

PHP has really come along. When PHP first came out a lot of hosting companies didn't offer it as there were a lot of changes and most web apps were all PHP4 anyway. Well, like I said, PHP has come a long way and the release of PHP 5.2 and newer stats showing PHP 5 is well on its way to dominate the server side language market. I don't think I know of a hosting company that only hosts PHP 4 and if they did I'd never use them.

Tags: PHP