2

I'm trying out OpenShift for the first time. I'm using the php-5.4 cartridge and I'm trying to deploy a Laravel project.

Laravel requires the document root to point to the public directory which is one level into the framework structure.

I see here that php cartridge's document root could be any of several specific directory names including public.

The problems I'm having are that:

  1. Once I push my project to the server, openshift doesn't seem to see the public folder automatically.

  2. I can't find the webroot itself.

When I ssh into the server and list my home directory I see the following directories:

    app-deployments
    app-root
    git
    php

I thought the php directory would be the root that the docs talk about, but that seems to contain all of the configurations for php itself. I then figured it may be in app-root or app-deployments, but when I grep -Ri Laravel * in my home to look for anything with laravel in it (like the readme) but I get nothing in return (and I know I pushed to the server).


I know and believe that the php cartridge will programmatically look for the directory names to determine the root, but where does it start that search? If there's a specific spot in the documentation where it's explained, could someone post the link to it because I can't seem to find it?

Edit

I should also add that I tried to check the normal linux /var/www directory, but my user doesn't have access to the directory and my user is not (at least I don't think I am) a super user.

Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137

2 Answers2

1

Try: grep -D skip -Ri Laravel *
It should be in: ~/app-root/runtime/repo

user32
  • 177
  • 1
  • 2
  • That's definitely the spot. Once I got there I found that there was an error with my push so the files were not up, but I was able to create the various folder by hand in this directory and confirm that it indeed the root. Thanks for the help! – Chris Schmitz Jan 19 '15 at 02:53
0

From OpenShift's Developer Portal entry on PHP Repo Layout:

Document root

Apache DocumentRoot, the directory that forms the main document tree visible from the web, is selected based on the existence of a common directory in the repository code in the following order:

1. php/          # for backward compatibility with OpenShift Origin v1/v2
2. public/       # Zend Framework v1/v2, Laravel, FuelPHP, Surebert etc.
3. public_html/  # Apache per-user web directories, Slim Framework etc.
4. web/          # Symfony etc.
5. www/          # Nette etc.
6. ./            # Drupal, Wordpress, CakePHP, CodeIgniter, Joomla, Kohana, PIP etc.

PHP include_path

The following application directories, that might exist in the repository code, are added to the PHP include_path and thus automatically searched when calling require(), include() and other file I/O functions:

- lib/
- libs/
- libraries/
- src/
- misc/
- vendor/
- vendors/
luciddreamz
  • 2,073
  • 14
  • 15
  • Thanks luciddreamz, I did read this documentation when I was trying to figure it out (that's the part of the docs that I was referring to in my question) my issue was trying to figure out where in the server structure those folders were looked for by openshift. It didn't say in the docs (or at least I didn't see it) that openshift starts looking for those folders in `app-root/runtime/repo/`. It's definitely helpful to know what it looked for, I just didn't know where it started looking. – Chris Schmitz Mar 20 '15 at 12:34
  • Got it. For what it's worth there is now a [Laravel 5 QuickStart](https://hub.openshift.com/quickstarts/115-laravel-5-0) to handle all of the OpenShift config details. – luciddreamz Mar 20 '15 at 17:08