在服务器上部署 Laravel 工程

php中文网
发布: 2016-06-06 20:17:16
原创
1692人浏览过

laravel 框架写了一个工程,已经在本机测试好了,准备部署到一台外网服务器(阿里云的)。

目前这台服务器操作系统是 Ubuntu 12.04,装了 PHP 5.6.18,根据 JellyBool 的帖子 进行了 Nginx 配置,访问后是 Laravel 的出错页面,如下:

简单工人维修404错误页面模板
简单工人维修404错误页面模板

哎呦~ 服务器居然累倒了! ●别急,工程师正在紧急处理,马上就好。 ●您可致电010-*****转8169,***通知***开发人员! ●***的进步需要您的反馈,感谢您对***的使用,请您耐心等待!

简单工人维修404错误页面模板 110
查看详情 简单工人维修404错误页面模板

在服务器上部署 Laravel 工程

看了一下 larval.log 中的 log,内容如下:

<code>    [2016-02-25 10:24:42] production.ERROR: exception 'ReflectionException' with message 'Class AppHttpControllersOfficialWebsiteController does not exist' in /var/www/shark/vendor/illuminate/routing/Route.php:264
    Stack trace:
    #0 /var/www/shark/vendor/illuminate/routing/Route.php(264): ReflectionMethod->__construct('App\Http\Contro...', 'index')
    #1 /var/www/shark/vendor/illuminate/routing/Router.php(838): IlluminateRoutingRoute->signatureParameters('Illuminate\Data...')
    #2 /var/www/shark/vendor/illuminate/routing/Router.php(823): IlluminateRoutingRouter->substituteImplicitBindings(Object(IlluminateRoutingRoute))
    #3 /var/www/shark/vendor/illuminate/routing/Router.php(806): IlluminateRoutingRouter->substituteBindings(Object(IlluminateRoutingRoute))
    #4 /var/www/shark/vendor/illuminate/routing/Router.php(670): IlluminateRoutingRouter->findRoute(Object(IlluminateHttpRequest))
    #5 /var/www/shark/vendor/illuminate/routing/Router.php(654): IlluminateRoutingRouter->dispatchToRoute(Object(IlluminateHttpRequest))
    #6 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): IlluminateRoutingRouter->dispatch(Object(IlluminateHttpRequest))
    #7 [internal function]: IlluminateFoundationHttpKernel->IlluminateFoundationHttp{closure}(Object(IlluminateHttpRequest))
    #8 /var/www/shark/vendor/illuminate/routing/Pipeline.php(52): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #9 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): IlluminateRoutingPipeline->IlluminateRouting{closure}(Object(IlluminateHttpRequest))
    #10 [internal function]: IlluminateFoundationHttpMiddlewareCheckForMaintenanceMode->handle(Object(IlluminateHttpRequest), Object(Closure))
    #11 /var/www/shark/vendor/illuminate/pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
    #12 [internal function]: IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))
    #13 /var/www/shark/vendor/illuminate/routing/Pipeline.php(32): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #14 [internal function]: IlluminateRoutingPipeline->IlluminateRouting{closure}(Object(IlluminateHttpRequest))
    #15 /var/www/shark/vendor/illuminate/pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #16 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): IlluminatePipelinePipeline->then(Object(Closure))
    #17 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): IlluminateFoundationHttpKernel->sendRequestThroughRouter(Object(IlluminateHttpRequest))
    #18 /var/www/shark/public/index.php(54): IlluminateFoundationHttpKernel->handle(Object(IlluminateHttpRequest))
    #19 {main}  
  </code>
登录后复制

执行过 composer dump-autoload,提示一行绿字 Generating autoload files,没有成功失败提示。

另外,php 没有启用 openssl,尝试启用但是遇到一些麻烦,不知道目前是否有必要,暂时没有启用。

回复内容:

用 laravel 框架写了一个工程,已经在本机测试好了,准备部署到一台外网服务器(阿里云的)。

目前这台服务器操作系统是 Ubuntu 12.04,装了 PHP 5.6.18,根据 JellyBool 的帖子 进行了 Nginx 配置,访问后是 Laravel 的出错页面,如下:

在服务器上部署 Laravel 工程

看了一下 larval.log 中的 log,内容如下:

<code>    [2016-02-25 10:24:42] production.ERROR: exception 'ReflectionException' with message 'Class AppHttpControllersOfficialWebsiteController does not exist' in /var/www/shark/vendor/illuminate/routing/Route.php:264
    Stack trace:
    #0 /var/www/shark/vendor/illuminate/routing/Route.php(264): ReflectionMethod->__construct('App\Http\Contro...', 'index')
    #1 /var/www/shark/vendor/illuminate/routing/Router.php(838): IlluminateRoutingRoute->signatureParameters('Illuminate\Data...')
    #2 /var/www/shark/vendor/illuminate/routing/Router.php(823): IlluminateRoutingRouter->substituteImplicitBindings(Object(IlluminateRoutingRoute))
    #3 /var/www/shark/vendor/illuminate/routing/Router.php(806): IlluminateRoutingRouter->substituteBindings(Object(IlluminateRoutingRoute))
    #4 /var/www/shark/vendor/illuminate/routing/Router.php(670): IlluminateRoutingRouter->findRoute(Object(IlluminateHttpRequest))
    #5 /var/www/shark/vendor/illuminate/routing/Router.php(654): IlluminateRoutingRouter->dispatchToRoute(Object(IlluminateHttpRequest))
    #6 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): IlluminateRoutingRouter->dispatch(Object(IlluminateHttpRequest))
    #7 [internal function]: IlluminateFoundationHttpKernel->IlluminateFoundationHttp{closure}(Object(IlluminateHttpRequest))
    #8 /var/www/shark/vendor/illuminate/routing/Pipeline.php(52): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #9 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): IlluminateRoutingPipeline->IlluminateRouting{closure}(Object(IlluminateHttpRequest))
    #10 [internal function]: IlluminateFoundationHttpMiddlewareCheckForMaintenanceMode->handle(Object(IlluminateHttpRequest), Object(Closure))
    #11 /var/www/shark/vendor/illuminate/pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
    #12 [internal function]: IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))
    #13 /var/www/shark/vendor/illuminate/routing/Pipeline.php(32): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #14 [internal function]: IlluminateRoutingPipeline->IlluminateRouting{closure}(Object(IlluminateHttpRequest))
    #15 /var/www/shark/vendor/illuminate/pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(IlluminateHttpRequest))
    #16 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): IlluminatePipelinePipeline->then(Object(Closure))
    #17 /var/www/shark/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): IlluminateFoundationHttpKernel->sendRequestThroughRouter(Object(IlluminateHttpRequest))
    #18 /var/www/shark/public/index.php(54): IlluminateFoundationHttpKernel->handle(Object(IlluminateHttpRequest))
    #19 {main}  
  </code>
登录后复制

执行过 composer dump-autoload,提示一行绿字 Generating autoload files,没有成功失败提示。

另外,php 没有启用 openssl,尝试启用但是遇到一些麻烦,不知道目前是否有必要,暂时没有启用。

OfficialWebsiteController does not exist
反射这个控制器,没有找到,看看是不是命名大小写的问题

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号