Skip to content

Instantly share code, notes, and snippets.

@sam452
Created February 19, 2016 20:05
Show Gist options
  • Save sam452/6babb2c4ac9c31dc25b2 to your computer and use it in GitHub Desktop.
Save sam452/6babb2c4ac9c31dc25b2 to your computer and use it in GitHub Desktop.
dang PHP require. PHP sees the file, why is artisan not finding it?
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/
$compiledPath = __DIR__.'/cache/compiled.php';
if (file_exists($compiledPath)) {
require $compiledPath;
}
PHP Warning: require(/media/psf/Home/apps/customer/bootstrap/vendor/autoload.php): failed to open stream: No such file or directory in /media/psf/Home/apps/customer/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /media/psf/Home/apps/customer/artisan:0
PHP 2. require() /media/psf/Home/apps/customer/artisan:16
$a = '/media/psf/Home/apps/customer/bootstrap/autoload.php';
if (is_file($a)) {echo 'ya';}
ya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment