Setting up PHP-FPM with Nginx on Ubuntu

Nginx, PHP, Uncategorized

In a previous post, I discussed how to use Nginx and Apache together on Ubuntu. I have Nginx listening on port 80 and Apache listening on port 8080. I use the Nginx proxy_pass directive to pass all PHP and Django domains (virtual hosts) to Apache. I will continue to use Apache for my existing virtual hosts, but I am going to use PHP-FPM for any new PHP domains that I set up.

Continue reading

Checkout My New Site - T-shirts For Geeks

Drupal: Adding an component to existing Feature using Drush

Drupal, PHP

On a recent Drupal (link) project, I installed the Environment Indicator module (link). One of the great aspects of this module is that it integrates with the Features (link) module. After featurizing the module’s configuration, I decided that I also wanted the feature to include the user permissions. I found that there are multiple ways to add a component to an existing feature.

Continue reading

Checkout My New Site - T-shirts For Geeks

Drupal: Dependent dropdowns with jQuery

Ajax, Drupal, Javascript, JQuery, PHP

I have told my co-workers on many occasions that Drupal doesn’t do true Ajax. With true Ajax, elements change without a page refresh and only the relevant elements are affected. With Drupal, the elements change because the entire form is refreshed. For instance, if you use Drupal’s Ajax to make the values of one dropdown dependent upon the selected value of another, the entire form has to be refreshed in order for the second dropdown to be updated (See Ajax Example: Dependent Dropdown). Although, there are times when I do use Drupal’s Ajax in this scenario, I much prefer to use jQuery.

Continue reading

Checkout My New Site - T-shirts For Geeks

Drupal: Using the Features API in Your Module

Drupal, PHP

Although, I have not written many posts about Drupal, I have actually worked more with Drupal over the last 4-5 year than any other web technology (except for jQuery). I recently created a module to control the display of a content type’s fields based upon roles (node add/edit). I created an import/export of the modules settings so that each environment (development, test, production) could be easily updated. The problem is that import/export is such a manual process that it was often overlooked during a deployment. So I decided to use the Features API to featurize my module’s settings.

Continue reading

Checkout My New Site - T-shirts For Geeks

Using Zend Framework with Drupal

Drupal, PHP, Zend Framework

I have been using ExpressionEngine and Zend Framework on my current project. We recently migrated the cms to Drupal (see migration), but we wanted to keep the Zend Framework apps. Most of the content of the website is handled by Drupal 7 (link), but certain urls on the website are handled by Zend Framework. On the Zend pages, I removed all layout information so that it is controlled by the Drupal theme.

Continue reading

Checkout My New Site - T-shirts For Geeks

Periods (dot) Converted in PHP Variables

Pebblet, PHP

I just ran into a problem when I was attempting to pass a PHP POST variable that contained a period. I’m not sure why I have never run into this situation in the past. PHP will automatically convert a period into an underscore. I submitted a form  with a field with the name ‘co.uk’. I then checked for the existence of the post variable in a PHP class (if  $_POST[‘co.uk’]). It did not exist. I then checked (if $_POST[‘co_uk’]) and was able to get the value. Interesting.

Checkout My New Site - T-shirts For Geeks