.php files included in theme cause 500 error

I’m using theme from themeforest and it has worked before I moved using bedrock.
(using root-dir installation with composer)

So my problem is that theme has 2 files:
functions.js.php (js-file with embedded php)
light.php (css-file with embedded php)

Requesting those files causes 500 error. This must be about custom wp-content dir or /wp installed into subdirectory.

I use apache locally and nginx in production and theme is not working in either.

All other .css and .js files in theme work so this is strange.

Well my php-logs show this:
[08-Apr-2014 00:24:37 Europe/Helsinki] PHP Warning: require_once(../../../../../wp-load.php): failed to open stream: No such file or directory in /Users/onnimonni/Projects/bedrock-dokku/web/app/themes/wanhakop/css/skins/light.php on line 4 [08-Apr-2014 00:24:37 Europe/Helsinki] PHP Fatal error: require_once(): Failed opening required '../../../../../wp-load.php' (include_path='.:/Applications/MAMP/bin/php/php5.5.3/lib/php') in /Users/onnimonni/Projects/bedrock-dokku/web/app/themes/wanhakop/css/skins/light.php on line 4 [08-Apr-2014 00:24:37 Europe/Helsinki] PHP Warning: require_once(../../../../wp-load.php): failed to open stream: No such file or directory in /Users/onnimonni/Projects/bedrock-dokku/web/app/themes/wanhakop/js/functions.js.php on line 6 [08-Apr-2014 00:24:37 Europe/Helsinki] PHP Fatal error: require_once(): Failed opening required '../../../../wp-load.php' (include_path='.:/Applications/MAMP/bin/php/php5.5.3/lib/php') in /Users/onnimonni/Projects/bedrock-dokku/web/app/themes/wanhakop/js/functions.js.php on line 6

What might cause this?

That theme is at fault. See: http://ottopress.com/2010/dont-include-wp-load-please/

Thank you for this! I’ll change it accordingly :blush: