August 30, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Setting Up OpenShift for PHP Cloud Development, Page 2

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

Using your OpenShift login and password, execute the $rhc setup command. This command sets up our SSH key, so that you can securely communicate with Git, and creates a namespace for all your applications to be grouped under.

After running the rhc setup command, you should get something like in the next figure:

Run rhc setup command for uploading SSH keys and setting the namespace for the application
Figure 6 - Run rhc setup command for uploading SSH keys and setting the namespace for the application

You may notice, from the above figure, that my namespace for the incoming application is OctaviaExamples and, as I said in the section "Create an OpenShift account", was set after I created my OpenShift account, from OPENSHIFT MANAGEMENT CONSOLE, My account tab.

My OpenShift Account containing namespace and SSH keys, after running the rhc setup command
Figure 7 - My OpenShift Account containing namespace and SSH keys, after running the rhc setup command

Create a PHP 5.3 Cloud Application from Command Line

To create a PHP cloud application from the command line, you only need to use the $ rhc app create $appName php-5.3 command. My application name is firstExample, as you can see from the next figure:

Creating first cloud application from command line
Figure 8 - Creating first cloud application from command line

Going into the cloud account, application firstExample should appear now, in the My Applications tab:

My Applications tab from the OpenShift Account containing the first application created above
Figure 9 - My Applications tab from the OpenShift Account containing the first application created above

Testing the application on cloud, you should get something like the next figure:

Testing the firstExample application in the cloud
Figure 10 - Testing the firstExample application in the cloud

Next, is a list containing the most important commands you can use to control your application:

1. Create - Create an application and add it to a domain

2. git-clone - Clone and configure an application's repository locally

3. delete - Delete an application from the server

4. start - Start the application

5. stop - Stop the application

For example, if we want to delete the firstExample application we will use the following command:

$ rhc app delete firstExample

Of course, you can delete an application from your management console, in your OpenShift account.


Tags: PHP, cloud development

Originally published on http://www.developer.com.

Page 2 of 4



Comment and Contribute

 


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

 

 


Sitemap | Contact Us

Rocket Fuel