John Mccandles
John Mccandles

Reputation: 1231

How to set up Laravel 5.1 on Openshift?

Openshift only has Laravel 5.0 offered as an application, and PHP 5.4 application. However Laravel 5.1 need PHP 5.5.9+. So has anybody tried to set up Laravel 5.1 on Openshift successfully? Some helps needed. Thanks.

Upvotes: 0

Views: 2086

Answers (2)

John Mccandles
John Mccandles

Reputation: 1231

It took me a while to find a way to install PHP 5.6 by using https://github.com/JVerstry/openshift-php-framework-stack , but the sad thing is that when I tried to install Laravel 5.1 based on it, it automatically used OpenShift's own PHP (5.3.3). Even I tried export my own PHP into path, the installation would still fail.

I gave it up. A pity that Openshift doesn't offer Laravel 5.1 support. I switched to DigitalOcean and it saved my day. I am using Laravel 5.2.37 & PHP 7.0.7 on DigitalOcean now.

Upvotes: 1

Bikram Tuladhar
Bikram Tuladhar

Reputation: 9

  • Create HHVM Application
  • Then Clone the current application repo in local machine

Create laravel app

  • using laravel installer

    laravel new test

  • using composer

    composer create-project --prefer-dist laravel/laravel test

Then move all file including hidden files from test to laravel52 (cloned folder) folder

  • remove /vendor and .env line from .gitgnore file

Edit NGINX server config file which is located at

config/nginx.d/default.conf.erb

Change:

root  <%= ENV['OPENSHIFT_REPO_DIR'] %><%= ENV['NGINX_WWW_ROOT'] %>;

To:

root  <%= ENV['OPENSHIFT_REPO_DIR'] %>public;

change:

location / {

    try_files $uri $uri/ =404;
}

To:

location / {

  try_files $uri $uri/ /index.php?$query_string;
 }

save default.conf.erb file and git commit

git add .
git commit -am "fix nginx server"
git push

After that visit site, you should see laravel welcome page.

Note: When you connect database, don't forget to put openshift database variable in .env file.

source ubutnu nepal blog

Upvotes: 1

Related Questions