Press "Enter" to skip to content

Richy's Random Ramblings

Running Jenkins CI for PHP on Amazon EC2 [3/7]

Continued from Signing up to Amazon EC2 and starting your first image Preparing PuTTY Note: These instructions are based on the Windows version of PuTTY and PuTTYgen Download an install PuTTY and PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/ (if there is an “install all” install for your platform, use that) Load PuTTYgen Click Load (“Load an existing private key file”) Select “Show all files (*.*)” in the “Load” box instead of the “PuTTY Private Key Files (*.ppk)” Select your Amazon EC2 Key (such as AmazonInstance.pem) Click Load You should receive the “Succesfully imported foreign key” message Click “Save private key” (select Yes to “Are you sure you want to save this key without a passphrase to protect it?”) Save the file somewhere save Continued in Connecting to Amazon EC2 using PuTTY

Running Jenkins CI for PHP on Amazon EC2 [2/7]

Continued from Part 1 – Introduction Signing up to Amazon EC2 and starting your first image Sign up to Amazon’s AWS service at http://aws.amazon.com You will be prompted for payment details, but you won’t be charged if you use Amazon’s free Micro EC2 instance Wait for your account to be created – you will get an email once done, but it’ll take a few hours (it took me 3 hours) Log back into http://aws.amazon.com and select “Amazon EC2” Select the closest region to yourself in the left hand side Select “Launch instance” and, if prompted, select “Launch classic wizard” Select, from the Quck Start tab, the “Basic 64 Bit Amazon Linux AMI” image. This should be near the top and indicated with a big gold star to indicate “Free tier eligible if used with a micro instance”. Click continue Set the number of instances to 1 and the Instance type to “Micro”. Under “Launch instances”, select an EC2 availability zone or just leave it set to “No preference”. Click continue. Ignore the “Advanced instance options” and just click continue Ignore the Tags page and just click continue Select “Create a new Key Pair” and give it a name (such as…

Running Jenkins CI for PHP on Amazon EC2 [1/7]

Introduction To ensure code quality for your PHP application, you might want to use a continuous integration service such as Jenkins CI (previously known as Hudson) to run things like PHPUnit, Code Coverage checks, PHP Mess Detector etc. But how do you install and run this cheaply? This series of 7 “easy to follow” tutorials will let you start and stop an Amazon EC2 “Micro” instance (which is free for your first year using Amazon) for testing. These posts will be published on a daily basis between the 27th of October and 2nd of November inclusive. Signing up to Amazon EC2 and starting your first image Preparing PuTTY for Amazon EC2 Connecting to Amazon EC2 using PuTTY Installing and Configuring Jenkins CI (this is the big/important post) Make a backup of the Amazon EC2 configuration Relaunching the Amazon EC2 image

PHP: PHP Programming on Windows using JetBrains PhpStorm and local PHP

Here’s some steps which may help somebody else install PHP on their Windows machine to run alongside JetBrain’s PhpStorm for PHPUnit testing Download Windows PHP from http://windows.php.net/download/ . I selected PHP 5.3.8 ‘s VC9 x86 Thread Safe (2011-Aug-23 12:01:10) Installer. Install, with no web server configurations, to C:\Program Files (x86)\PHP Download the appropriate APC module from http://downloads.php.net/pierre/ to match your PHP version. I picked: http://downloads.php.net/pierre/php_apc-3.1.5-5.3-vc9-x86.zip Copy the enclosed php_apc.dll from that .zip file to C:\program files\x86\PHP\ext Download the appropriate XDebug module from http://xdebug.org/download.php to match your PHP version. I picked: http://xdebug.org/files/php_xdebug-2.1.2-5.3-vc9.dll Save the file to c:\program files\x96\PHP\ext (I had to save it as c:\users\richyc and then, from my administrator command prompt (see below) do “cp c:\users\richyc\php_xdebug-2.1.2-5.3-vc9.dll.dll “c:\program files (x86)\php\ext”) Start a command prompt, cmd.exe, with administration rights (Windows->Search->cmd.exe right click and then “Run as administrator”) In the command prompt, enter the following: cd “c:\program files (x86)\php\pear” php go-pear.phar Are you install a system-wide PEAR or a local copy? system Accept all defaults pear upgrade pear pear config-set auto_discover 1 pecl channel-update pecl.php.net pecl config-set php_suffix .exe pecl install channel://pecl.php.net/dbus-0.1.1 pear install channel://pear.php.net/HTTP_REQUEST2-2.0.0RC2 channel://pear.php.net/Net_URL2-0.3.1 pear/XML_RPC2 pear install pear.phpunit.de/PHPUnit phpunit/DbUnit phpunit/PHPUnit_Selenium phpunit/PHPUnit_Story phpunit/PHP_Invoker echo extension = php_apc.dll >> ../php.ini echo zend_extension =…