Filesystem.php - 无法打开流
Filesystem.php - failed to open stream
我使用 Laravel 制作了多个网络应用程序,所以这不是我的第一个产品部署。但是 - 我遇到了一个奇怪的问题,我似乎无法找到答案。与我迄今为止完成的所有应用程序一样 - 我 copy/pasted 所有文件到生产服务器,设置 .env 文件,在配置文件夹中编辑 app.php 和 database.php 但我不断收到此错误:
ErrorException in ClassLoader.php line 412:
include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php):
failed to open stream: No such file or directory
in ClassLoader.php line 412
at HandleExceptions->handleError('2', 'include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory', '/home/xxxxx/public_html/appname/vendor/composer/ClassLoader.php', '412', array('file' => '/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php')) in ClassLoader.php line 412
at Composer\Autoload\includeFile() in ClassLoader.php line 412
at Composer\Autoload\includeFile('/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php') in ClassLoader.php line 301
at ClassLoader->loadClass('Illuminate\Filesystem\Filesystem')
at spl_autoload_call('Illuminate\Filesystem\Filesystem') in Application.php line 539
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 253
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
现在...到目前为止,我已经尝试了在网上找到的所有内容。清除缓存、检查文件权限、运行 composer dump 自动加载、重新上传所有文件——但似乎无济于事。它是与 PHP v5.6 共享的主机,已经有几个 laravel 应用程序 运行,并且它们运行良好。唯一不同的是,这个是laravel 5.3,另一个是5.2.
我在本地开发机器上没有错误。
有什么想法吗!?
这可能是由于网络托管本身的某些安全功能处于活动状态而导致的。提到的 class 被标记为恶意软件并且 AV 在 upload/reupload 上不断删除它。由于缺少整个 file/class - 应用程序抛出上述错误。
如果您没有 运行 自己的服务器并且无法将文件列入白名单,只需联系您的托管服务提供商即可。
我在这里 https://laracasts.com/discuss/channels/laravel/filesystemphp 找到了解决方案。
可能是因为函数link中使用了exec函数。只需删除这部分:
/**
* Create a hard link to the target file or directory.
*
* @param string $target
* @param string $link
* @return void
*/
public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link)
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
}
我使用 Laravel 制作了多个网络应用程序,所以这不是我的第一个产品部署。但是 - 我遇到了一个奇怪的问题,我似乎无法找到答案。与我迄今为止完成的所有应用程序一样 - 我 copy/pasted 所有文件到生产服务器,设置 .env 文件,在配置文件夹中编辑 app.php 和 database.php 但我不断收到此错误:
ErrorException in ClassLoader.php line 412:
include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php):
failed to open stream: No such file or directory
in ClassLoader.php line 412
at HandleExceptions->handleError('2', 'include(/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php): failed to open stream: No such file or directory', '/home/xxxxx/public_html/appname/vendor/composer/ClassLoader.php', '412', array('file' => '/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php')) in ClassLoader.php line 412
at Composer\Autoload\includeFile() in ClassLoader.php line 412
at Composer\Autoload\includeFile('/home/xxxxx/public_html/appname/vendor/composer/../laravel/framework/src/Illuminate/Filesystem/Filesystem.php') in ClassLoader.php line 301
at ClassLoader->loadClass('Illuminate\Filesystem\Filesystem')
at spl_autoload_call('Illuminate\Filesystem\Filesystem') in Application.php line 539
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 253
at Kernel->bootstrap() in Kernel.php line 144
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
现在...到目前为止,我已经尝试了在网上找到的所有内容。清除缓存、检查文件权限、运行 composer dump 自动加载、重新上传所有文件——但似乎无济于事。它是与 PHP v5.6 共享的主机,已经有几个 laravel 应用程序 运行,并且它们运行良好。唯一不同的是,这个是laravel 5.3,另一个是5.2.
我在本地开发机器上没有错误。
有什么想法吗!?
这可能是由于网络托管本身的某些安全功能处于活动状态而导致的。提到的 class 被标记为恶意软件并且 AV 在 upload/reupload 上不断删除它。由于缺少整个 file/class - 应用程序抛出上述错误。
如果您没有 运行 自己的服务器并且无法将文件列入白名单,只需联系您的托管服务提供商即可。
我在这里 https://laracasts.com/discuss/channels/laravel/filesystemphp 找到了解决方案。 可能是因为函数link中使用了exec函数。只需删除这部分:
/**
* Create a hard link to the target file or directory.
*
* @param string $target
* @param string $link
* @return void
*/
public function link($target, $link)
{
if (! windows_os()) {
return symlink($target, $link)
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
}