$ knife cookbook create php

$ cd cookbooks/php/recipes

$ vi default,rb

# found by using “yum search php”
package “php5” do
action :install
$ cd ~/cookbooks/apache
$ vi metadata.rb   # and add
depends   “php”
$ knife cookbook upload php
cd recipes
$ vi default.rb
# add the following at the end of the file
include_recipe “php::default”
$ knife cookbook upload apache
chef-client to run

This ensures php is installed before any Apache install.