Reputation: 24472
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.
"Add a new remote "openshift" (You can find the URL to your git repository on the Openshift application page)" What does that mean? how do I do that?
Run git push --force "openshift" master:master
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
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
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.
git clone https://github.com/boekkooi/openshift-diy-nginx-php.git
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