How to configure Laravel 5.2 on Openshift?

你说的曾经没有我的故事 提交于 2019-12-24 02:14:14

问题


I've been looking through tutorials and cartridges on how to use and configure Laravel in Openshift to no avail. Even the best things I could find didn't help that much. So far what I've been able to do is setup Laravel so I could see the welcome page that says "Laravel" in the middle.

What I did to achieve this is use these 2 cartridges:

  • PHP 5.6.16 - https://github.com/boekkooi/openshift-cartridge-php
  • Nginx - https://github.com/boekkooi/openshift-cartridge-nginx

With https://github.com/lucho2d7/openshift-quickstart-laravel5.2

Basically putting all of these together in a single rhc command:

rhc app create appname --env OPENSHIFT_PHP_VERSION=5.6.16 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-php mysql-5.5 --env OPENSHIFT_NGINX_VERSION=1.9.12 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-nginx --from-code=https://github.com/lucho2d7/openshift-quickstart-laravel5.2

This basically created an app with Nginx 1.9.12, PHP 5.6.16, MySQL 5.5, and Laravel 5.2.12 on Openshift:

Next thing I did was I noticed the Laravel 5.2.12 and ran composer update in the directory and got it to Laravel 5.2.30, and again when visiting the app I still saw Laravel.

Now comes the problem. I used the automatic login/registration maker command

php artisan make:auth

The command runs and everything is in it's appropriate folder, and when you access the app you see the modified welcome page with the Login and Register buttons on the top right:

However, when you click on Login, Register, and Home you get a 404 not found error on the page:

The path is the same for the other buttons such as pressing Login takes me to /login, Register takes me to /register, and Home takes me to /home all the while giving me the error page.

I haven't been able to come up with a solution to this problem. So far I've tried to add my URL to the app.php file in config folder, and other than that nothing else has been touched. I don't really have access to the httpd.conf file or using sudo in the server. Although I tried looking through the error logs, but couldn't find a solution through it either.

The error logs basically just repeat this one line for different error paths:

2016/04/26 00:18:27 [error] 337780#0: *121 open() "/var/lib/openshift/username/app-root/runtime/repo//public/login" failed (2: No such file or directory), client: ip, server: , request: "GET /login HTTP/1.1"

I actually have access to nginx_http.conf in /var/lib/openshift/username/nginx/conf which currently has this:

# Enable Gzip
gzip  on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_buffers     4 8k;
gzip_proxied any;
gzip_types
  # text/html is always compressed by HttpGzipModule
  text/css
  text/javascript
  text/xml
  text/plain
  text/x-component
  application/javascript
  application/json
  application/xml
  application/rss+xml
  font/truetype
  font/opentype
  application/vnd.ms-fontobject
  image/svg+xml;

gzip_static on;
gzip_proxied        expired no-cache no-store private auth;
gzip_disable        "MSIE [1-6]\.";
gzip_vary           on;

server {
    listen  ip:8080;
    root    /var/lib/openshift/username/app-root/runtime/repo//public;

    location / {
        index  index.html index.htm index.php;
    }

    # pass the PHP scripts to PHP-FPM
    location ~ \.php$ {
        fastcgi_pass unix:/var/lib/openshift/username/php//socket/php-username.socket;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        include /var/lib/openshift/username/nginx//usr/nginx-1.9.12/conf/fastcgi_params;
    }
}

Any help would be greatly appreicated!

来源:https://stackoverflow.com/questions/36855570/how-to-configure-laravel-5-2-on-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!