Archive

Archive for July, 2012

AWS: pcre lib conflict with

July 27, 2012 Leave a comment

Severity: Warning –> preg_match(): Compilation failed: unknown option bit(s) set at offset 0
restarted apache

upgraded “*php*”

and rebooted the instance

https://forums.aws.amazon.com/thread.jspa?messageID=366748

 

 

Please make sure you are using the latest version of pcre with the latest version of PHP. You can ensure both are up to date by running

sudo yum upgrade '*php*' pcre

Once everything has been updated please restart you web server through the init script for Apache HTTPD this can be done by doing

sudo service httpd restart
Advertisements
Categories: php, Software Engineering, Web Tags: , ,

Amazon Web Services : Cloud Watch API

July 18, 2012 Leave a comment

get_metric_statistics :  sdk php 1.5.10

http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonCloudWatch/get_metric_statistics

  1. $cw = new AmazonCloudWatch();
  2. $instance_id1 = “x-xxxxxx”;  // give you instance id for which you want to fetch statistics
  3. $instance_id1 = “x-xxxxxx”;  // give you instance id for which you want to fetch statistics
  4. $opts = array(“Dimensions” => array());
  5. $member = array(“Name” => “InstanceId”,”Value” => $instance_id1);
  6. array_push($opts[“Dimensions”], $member);
  7. $member = array(“Name” => “InstanceId”,”Value” => $instance_id2);
  8. array_push($opts[“Dimensions”], $member);
  9. $data = $cw->get_metric_statistics(‘AWS/EC2’, ‘CPUUtilization’, ‘-1 day’, ‘now’, ‘300’, array(‘Average’), ‘Percent’ ,$opts);