Where exactly is the document root in my openshift server?

1.5k views Asked by At

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.

2

There are 2 answers

1
user32 On BEST ANSWER

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

2
luciddreamz On

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/