PHP evaluated in rule works locally but not on remote server I have this code. When I run this on my local server, it works fine but when I run it on the remote server it does nothing. Not even the messages appear. I am using the devel module. Any help appreciated.

drupal_set_message('test');
dpm($node);
// send msg for skills
$arrayofprojectskills = array();
array_push($arrayofprojectskills, $node-&gt;field_project_skills['und']['0']['tid']);

$usersprofidstonotify = array();

foreach ($entity_list as $obj) {
    if ($obj-&gt;field_skills) {
        $profile1 = $obj-&gt;field_skills['und'];
        foreach ($profile1 as $innerar) {
            foreach ($arrayofprojectskills as $oneskill) {
                if (in_array($oneskill, $innerar)) {
                    array_push($usersprofidstonotify, $obj-&gt;pid);
                } else {

                }
            }
        }
    } else {
        //drupal_set_message('field skills has no values');
    }
}

$useridstonotify = array();

foreach ($entity_list as $obj) {

    foreach ($usersprofidstonotify as $user) {
        if (($obj-&gt;pid) == ($user)) {

            array_push($useridstonotify, ($obj-&gt;uid));
        }
    }
}

$arrayofprojectskillnames = array();
foreach ($node-&gt;field_project_skills['und'] as $fieldprojinner) {
    array_push($arrayofprojectskillnames, $fieldprojinner['name']);
}

$usersprofidstonotify = array();

$name = dpm($node-&gt;name);
$msg = $name;
$msg .= ' has posted a project called ';
$msg .= ($node-&gt;title);
$msg .= 'More details:';
$msg .= ($node-&gt;body['und']['0']['value']);
$msg .= ' They need the skills of ';
$msg .= implode(",", $arrayofprojectskillnames);
$msg .= 'Can you help them out YEAH!? ';
$msg .= ' If so, please sign up ';
$msg .= '&lt;a href="' . '/node/' . ($node-&gt;vid) . '"&gt;' . 'here&lt;/a&gt;';

foreach ($useridstonotify as $oneuser) {
    privatemsg_new_thread(array(user_load($oneuser)), 'Someone needs your skills', $msg);
}
Please follow below steps to debug.


Enable Rules Debug settings.
Enable the rule you created.
Check the messages given by rules debug messages on rule activation conditions.


Still if you cannot able to find the solution, check the error logs. 

You may need to change the format of collecting node values. Using "und" $node->field_project_skills['und']['0']['tid'] is not the right way. You can check below post that explains right way of reading node values.

http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way