Local: After moving Statamic above root, my local environment's front-end & control panel work as expected.

Remote: When I migrate to remote server, front end works but control panel's broken.

Debugging In browser's web inspector I'm seeing 404s for control panel CSS/JS.

Feels like this' a path issue. I'm following steps here: (https://docs.statamic.com/knowledge-base/running-above-webroot#main)

Anyone familiar with this? I figure I'm either missing a step/config, or maybe I need to move the control panel resources into the web root + somehow let Statamic know where they are. Hoping someone else has encountered similar and can give feedback.

[I FIXED]

Fixed It! Was an issue related to my .gitignore. There was a global rule in my git ignore that was ignoring several files and directories within Statamic /vendor /illuminate - after updating the .gitignore and removing the problematic rules. Then staging + commiting and pushing all of that back up into the remote I did another clone of the repo onto the remote server and everything is working as expected - front end and back end.

[Update]

In index.php I'm seeing the $resources var and thinking maybe this is where the path should be updated when the Statamic install is above root? But, I don't recall any mention of this in that KB article on moving above root.

Folder Structure

Top Level Directories

local/
public/
site/
statamic/

.env
please

Web Root maps to 'Public' within public are the following directories and files (there are additionals for Grunt, etc that I've left off for brevity)

assets/
img/
themes/project-theme/
themes/redwood/
index.php
.htaccess

System.yaml

locales:
  en:
    full: en_US
    name: English
    url: "{env:APP_SITE_URL}"
timezone: UTC
date_format: F jS, Y
default_extension: md
filesystems:
  content:
    driver: local
    root: site/content
  storage:
    driver: local
    root: site/storage
  users:
    driver: local
    root: site/users
  themes:
    driver: local
    root: public/themes
    url: /themes

... unrelated values here...

use_https: "{env:APP_USE_HTTPS}"

Index.php

$statamic = '../statamic';
$site_root = '/';
$rewrite_urls = true;
$control_panel = 'cp-name';
$locale = 'en';
$resources = '_resources';

.env

I'm using the following environment variables, including to pass the site url

APP_ENV=local
APP_SHOW_ENV_HUD="false"
APP_DEBUG=true
APP_DEBUG_BAR=true
HTTPS=off
APP_SITE_URL="http://projectname.local"
APP_USE_HTTPS=false
#QUEUE_DRIVER=redis# ONLY USING THIS ON THE REMOTE SERVERS
APP_USE_MINIFIED_RESOURCES=false

Statamic Logs

Seeing this error in the log file:

ErrorException: include(/www/sandbox_html/statamic/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Debug/ExceptionHandler.php): failed to open stream: No such file or directory
in /www/sandbox_html/statamic/vendor/composer/ClassLoader.php:444 

[2019-07-02 19:47:49] production.ERROR: ErrorException: include(/www/sandbox_html/statamic/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Debug/ExceptionHandler.php): failed to open stream: No such file or directory in /www/sandbox_html/statamic/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/USER...', '/USER...', 444, Array)
#1 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include()
#2 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...')
#4 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(14): spl_autoload_call('Illuminate\\Cont...')
#5 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#6 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#7 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Foun...')
#8 /www/sandbox_html/statamic/core/Exceptions/Handler.php(18): spl_autoload_call('Illuminate\\Foun...')
#9 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#10 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#11 [internal function]: Composer\Autoload\ClassLoader->loadClass('Statamic\\Except...')
#12 [internal function]: spl_autoload_call('Statamic\\Except...')
#13 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('Statamic\\Except...')
#14 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Statamic\\Except...', Array)
#15 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Statamic\\Except...', Array)
#16 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(220): Illuminate\Foundation\Application->make('Statamic\\Except...', Array)
#17 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(Statamic\Application), Array)
#18 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#19 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#20 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(1167): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#21 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(269): Illuminate\Container\Container->offsetGet('Illuminate\\Cont...')
#22 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(89): Illuminate\Foundation\Http\Kernel->reportException(Object(ErrorException))
#23 /www/sandbox_html/public/index.php(159): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#24 {main}  
[2019-07-02 19:47:54] production.ERROR: ErrorException: include(/www/sandbox_html/statamic/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Debug/ExceptionHandler.php): failed to open stream: No such file or directory in /www/sandbox_html/statamic/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/USER...', '/USER...', 444, Array)
#1 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include()
#2 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...')
#4 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(14): spl_autoload_call('Illuminate\\Cont...')
#5 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#6 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#7 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Foun...')
#8 /www/sandbox_html/statamic/core/Exceptions/Handler.php(18): spl_autoload_call('Illuminate\\Foun...')
#9 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#10 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#11 [internal function]: Composer\Autoload\ClassLoader->loadClass('Statamic\\Except...')
#12 [internal function]: spl_autoload_call('Statamic\\Except...')
#13 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('Statamic\\Except...')
#14 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Statamic\\Except...', Array)
#15 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Statamic\\Except...', Array)
#16 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(220): Illuminate\Foundation\Application->make('Statamic\\Except...', Array)
#17 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(Statamic\Application), Array)
#18 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#19 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#20 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(1167): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#21 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(269): Illuminate\Container\Container->offsetGet('Illuminate\\Cont...')
#22 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(89): Illuminate\Foundation\Http\Kernel->reportException(Object(ErrorException))
#23 /www/sandbox_html/public/index.php(159): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#24 {main}  
[2019-07-02 19:48:20] production.ERROR: ErrorException: include(/www/sandbox_html/statamic/vendor/composer/../laravel/framework/src/Illuminate/Contracts/Debug/ExceptionHandler.php): failed to open stream: No such file or directory in /www/sandbox_html/statamic/vendor/composer/ClassLoader.php:444
Stack trace:
#0 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'include(/USER...', '/USER...', 444, Array)
#1 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include()
#2 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...')
#4 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(14): spl_autoload_call('Illuminate\\Cont...')
#5 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#6 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#7 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Foun...')
#8 /www/sandbox_html/statamic/core/Exceptions/Handler.php(18): spl_autoload_call('Illuminate\\Foun...')
#9 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(444): include('/USER...')
#10 /www/sandbox_html/statamic/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/USER...')
#11 [internal function]: Composer\Autoload\ClassLoader->loadClass('Statamic\\Except...')
#12 [internal function]: spl_autoload_call('Statamic\\Except...')
#13 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('Statamic\\Except...')
#14 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('Statamic\\Except...', Array)
#15 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Statamic\\Except...', Array)
#16 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(220): Illuminate\Foundation\Application->make('Statamic\\Except...', Array)
#17 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(Statamic\Application), Array)
#18 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#19 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#20 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Container/Container.php(1167): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#21 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(269): Illuminate\Container\Container->offsetGet('Illuminate\\Cont...')
#22 /www/sandbox_html/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(89): Illuminate\Foundation\Http\Kernel->reportException(Object(ErrorException))
#23 /www/sandbox_html/public/index.php(159): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#24 {main}  


Answered by Reuben! Go to answer.