October 21, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

PHP Cloud Development on Red Hat's OpenShift PaaS

  • April 2, 2013
  • By Octavia Andreea Anghel
  • Send Email »
  • More Articles »

OpenShift is Red Hat's Cloud Computing Platform as a Service (PaaS) offering. For PHP cloud development, OpenShift offers an application platform in the cloud where you can build, test, deploy, and run your applications. Also, OpenShift enables you to use a great variety of the latest and greatest technology Quickstarts that allow you to boot your favorite platform on OpenShift almost instantaneously.

All you need to do to begin PHP cloud development on OpenShift is take three simple steps: Sign up and create an account on OpenShift, find the QuickStart for your favorite platform and follow the instructions on the Quickstart page (usually in the README.md file), and host that platform on OpenShift. Your favorite platform is available on OpenShift, and you can start on your project!

What you can do on cloud?

  • Host and run your own blog on your own server using Wordpress Quickstart.
  • Set up your own e-commerce site for your burgeoning business using Magento e-commerce Quickstart.
  • Developing your own web application using web.py framework Quickstart.

Note: All the PHP application types are available on the official Openshift get started page.

Note: OpenShift Quickstarts can be found on GitHub under the 'OpenShift' account.

Create an OpenShift Account

Creating an OpenShift account is a very simple task: just follow the new account link and sign up with your email address and a password. After signing into your OpenShift account, you should see something like in the below figure:

OpenShift account management console
Figure 1 - OpenShift account management console

After creating the OpenShift account, you will receive a confirmation email, where you will find the next five steps. I list them here, just to point out how easy you can create a cloud application:

1. Go to the OpenShift Web Management Console
2. Choose an Instant Application like Wordpress or an Application Type like JBoss
3. Name your Application and Namespace
4. Click on your URL
5. Congratulations, you're in the cloud!

In the management Console of your OpenShift account, you need to set up the namespace under which your applications will be grouped under. You also have the option to set the namespace later, when creating applications, but I prefer to do this at this point. The namespace set for my incoming application is OctaviaExamples. As you can read in the next figure, the namespace is unique and it is contained in the public URL as a suffix: OctaviaExamples.rhcloud.com.

Setting up a namespace for your group of applications
Figure 2 - Setting up a namespace for your group of applications

Install OpenShift RHC Client Tool

"The OpenShift Client tool, known as rhc, is built and packaged using the Ruby programming language. OpenShift integrates with the Git version control system to provide powerful, decentralized version control for your application source code."

1) To install OpenShift Client tools you need to download Git for Windows. Download it and then run the installer. After the installation is completed, to verify that Git is correctly configured, go in the corresponding folder, where this application was installed and run the Git Bash executable, and run the $ git -- version command. If everything worked fine you should see something like the below figure:

Verifying installation for Git
Figure 3 - Verifying installation for Git

2) To install OpenShift Client tools you also need to download RubyInstaller 2.0.0. Download it and then run the installer.

Note: While running the setup you need to select the "Add Ruby executables to your PATH" check box so you can run Ruby from the command line. After the installation is completed, to verify that Ruby is correctly configured, go in the corresponding folder, where this application was installed and run the ruby -e 'puts "welcome"' command. If everything worked fine you should see something like figure below:

Verifying installation for Ruby
Figure 4 - Verifying installation for Ruby

3) After the Ruby and Git are successfully installed, use the RubyGems package manager (included in Ruby) to install the OpenShift client tools. Run the gem install rhc command and you should get something like the figure below:

Install RubyGems package
Figure 5 - Install RubyGems package


Tags: PHP, cloud development



Page 1 of 4



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel