Installing Kohana on OpenShift?

2019-06-06 07:26发布

问题:

How do I install Kohana v3.3.1 on Openshift? Do I create the PHP 5.3 cartridge and put the kohana files inside the php directory? Or do I create a Zend Server 5.6? I would like to use MySQL as well.

Kohana v3.3.1 requires PHP 5.3.3 or higher to work. I just created a PHP 5.3 Cartridge and git clone it to my harddrive and here is the file structure:

C:\mysite>ls -a
.  ..  .git  .openshift  README.md  deplist.txt  libs  misc  php

C:\mysite>

Inside the php directory

C:\mysite\php>ls -a
.  ..  health_check.php  index.php

C:\mysite\php>

When I edited php\index.php to echo "Hello World" I was able to see Hello World in my browser at my Openshift address http://xxxx-xxxx.rhcloud.com/

Any assistance will be greatly appreciated!


EDIT 1

I listed the cartridges and discovered Do-it-Yourself 0.1

rhc cartridge list

Is this Do-it-Yourself 0.1 cartridge building what I need to do to get Kohana working on Openshift?

回答1:

I would drop your code inside the basic php-5.3 application skeleton, and go from there.

You can add mysql to any application by listing it as a dependency during your rhc app create step, or by typing rhc cartridge add mysql from within your local project repo folder.

Once you get everything working, I would consider publishing the resulting repo to GitHub. This should allow others to spin up your openshift-compatible copy of Kohana by running:

rhc app create kohana php-5.3 mysql --from-code=http://github.com/YOUR_ACCOUNT/YOUR_PROJECT_NAME.git

(with YOUR_ACCOUNT and YOUR_PROJECT_NAME substituted into the above command)