TheUnreal
TheUnreal

Reputation: 24472

Using PHP 5.6 in OpenShift

I'm new to Git and OpenShift and I find it very difficult to use PHP 5.6 in OpenShift.

first, I was trying to setup my application with built-in php 5.4 of openshift, but I noticed I need version 5.6 or higher for it.

So.. I didnt some searching and found this: https://github.com/boekkooi/openshift-diy-nginx-php

To get PHP 5.6 working at OpenShift, you have to do the following:

Create a new Openshift "Do-It-Yourself" application
Clone this repository
Add a new remote "openshift" (You can find the URL to your git repository on the Openshift application page)
Run git push --force "openshift" master:master
SSH into your gear
Wait for build to finish (This may take at least an hour)
Open http://appname-namespace.rhcloud.com/ to verify

But since I'm a total newb, I don't really get what I need to do.

Running it returned: fatal: Not a git repository (or any parent up to mount point /var/lib/openshift) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). (Run via SSH)

Hope someone can help me with this. thanks!

Upvotes: 1

Views: 2069

Answers (2)

Jan Beeck
Jan Beeck

Reputation: 315

Try by running this on the terminal (YourApp is where is your DIY cartridge):

rhc cartridge add -a YourApp --env OPENSHIFT_PHP_VERSION=5.6.16 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-php

Upvotes: 0

Shobi
Shobi

Reputation: 11461

openshift is working in the basis of cartridges. There are many cartridges ready to deploy in openshift. But unfortunately there is no php5.4+ cartridges and there will not be a sudo command in a php5.4 cartridge so we can't update php. So you need a Do It Yourself Cartridge. You will have to download php 5.6 source code in to the DIY cartridge and compile & Install it yourself. Also you need a server say nginx.

Here is the step by step way to get this done.

  • Log Into opeshift webconsole.
  • Create a new application with DIY cartridge.
  • Goto home directory in your computer, open your terminal and type git clone https://github.com/boekkooi/openshift-diy-nginx-php.git
  • So that you will get a directory named openshift-diy-nginx-php in your home directory
  • Then open your openshift web console. and click on your newly created application name.
  • There you can see a field under source code at the right side of the screen .Image
  • Thats your source code of the DIY cartridge. So you need to push the files we downloaded before to this location.

  • So that you copy the url and goto the directory that we have downloaded and open terminel and type git remote add openshift ssh://url.git (don't forget to replace ssh://url.git with your source code url that we have copied)

  • Now you need to push the repository/directory to openshift. So that type this command in the same terminal git push --force "openshift" master:master

  • after finishing the push the build process starts. Log into your application via ssh if needed. There is a good tutorial in openshift that teaches how to login to openshift via ssh.

There you go with php 5.6 and NginX

If you need any help. comment please

Upvotes: 1

Related Questions