lumen、laravel 环境问题汇总
框架报500
1.chmod 777 -R storage 将日志目录权限设置下。
2.修改fastcgi,将代码目录包含进去。
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/www/";
3.nginx.conf
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
No application encryption key has been specified.
1、.env.example 改名使用命令 copy 修改为 .env
2、使用命令 php artisan key:generate 获取密码
[IlluminateContractsHttpKernel] is not instantiable
报错
(1/1) BindingResolutionExceptionTarget [Illuminate\Contracts\Http\Kernel] is not instantiable.
in Container.php line 945
at Container->notInstantiable('Illuminate\\Contracts\\Http\\Kernel')in Container.php line 785
at Container->build('Illuminate\\Contracts\\Http\\Kernel')in Container.php line 658
at Container->resolve('Illuminate\\Contracts\\Http\\Kernel', array())in Container.php line 609
at Container->make('Illuminate\\Contracts\\Http\\Kernel', array())in Application.php line 260
at Application->make('Illuminate\\Contracts\\Http\\Kernel')in index.php line 52
检查public/index.php
laravel的:
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
是这一句放到lumen里面就错了
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
把lumen的index.php拷过来就行了
lumen、laravel 环境问题汇总的更多相关文章
- lumen、laravel问题汇总
框架报500 1.chmod 777 -R storage 将日志目录权限设置下. 2.修改fastcgi,将代码目录包含进去. fastcgi_param PHP_ADMIN_VALUE " ...
- 关于Lumen / Laravel .env 文件中的环境变量是如何生效的
.env 文件包含默认环境变量,我们还可自定义其他任何有效的变量,并可通过 调用 env() 或 $_SERVER 或 $_ENV 来获取该变量.那么env()是如何加载到这些变量的呢?在Lume ...
- PHP Lumen Laravel 解决validate方法自定义message无效的问题
/** * 由于 \Laravel\Lumen\Routing\ProvidesConvenienceMethods::validate 在验证不通过时, * 抛出 \Illuminate\Valid ...
- lumen laravel response对象返回数据
Route::get('home', function () { $content = "内容"; $status = 301; $value = 'text/html'; // ...
- laravel方法汇总详解
1.whereRaw() 用原生的SQL语句来查询,whereRaw('select * from user') 就和 User::all()方法是一样的效果 2.whereBetween() 查询时 ...
- webpack配置构建环境问题汇总
环境:node 6.9.5 npm 3.10.10 问题一:Module build failed: TypeError: Path must be a string. Received undef ...
- Java 环境问题汇总
准备java环境时,需要设置JAVA_HOME 和 Path , CLASSPATH 环境变量,它们可以是用户变量,也可以是系统变量. 注意: 系统变量的路径排在用户变量之前. 其中,Windows操 ...
- Lumen框架—升级改造之路-仓储层
仓储层与逻辑层搭建 Lumen官方文档:https://lumen.laravel.com/docs/5.5 我的项目地址:https://github.com/BusinessL/big-lume ...
- Lumen框架—升级改造之路-开篇
一.前言 首先,我先阐述下,为什么要做这件事.lumen是一款比较轻型的PHP框架,但是,作为项目开发来说,它还是缺少很多东西,比如Response返回值规范的自定义,异常抛出格式的自定义,以及 ...
- Lumen实现用户注册登录认证
Lumen实现用户注册登录认证 前言 Lumen是一个基于Laravel的微框架,号称是以速度为生.截用Lumen官网的一段,号称是比silex和slim还要快. 本文将用Lumen来实现一个完整的用 ...
随机推荐
- Swift中的nil
Swift中的nil和OC中的nil不一样.OC中的nil表示不存在的对象,你无法给NSInteger类型的变量赋值nil,但是Swift中的nil表示不存在,可以给任何Optional的变量或者常量 ...
- ansible(14)--ansible的get_url模块
1. get_url模块 功能:通过互联网下载软件至被控端本地: 主要参数如下: 参数 说明 url 资源文件在互联网上的具体url地址 dest 文件下载位置的绝对路径 mode 文件下载位置的绝对 ...
- WEB服务与NGINX(3)-NGINX基础及配置文件
WEB服务与NGINX(3)-NGINX基础及配置文件 目录 WEB服务与NGINX(3)-NGINX基础及配置文件 1. NGINX初识与安装 1.1 NGINX特性 1.2 NGINX功能和应用场 ...
- Spring环境获取Spring的Bean
一.测试数据准备 /* Navicat Premium Data Transfer Source Server : swp-mysql Source Server Type : MySQL Sourc ...
- .NET C#导出解决方案的NuGet依赖关系
前言 公司项目需要写DS设计文档,文档需要标识出来你的解决方案文件下的所有项目都使用了NuGet哪些第三方依赖,我们都知道sln下面的所有.csproj文件中的节点下会标识出对应的依赖,但一个一个对比 ...
- AIRIOT可视化组态引擎如何应用于物联业务场景中
在物联网的业务应用场景中,可视化组态是一个必不可少的功能需求.不同的行业场景,都需要将物联设备采集的数据和业务场景状态进行直观的可视化展示,供使用者进行分析或决策.如工艺流程用能监测.3D场景构建.能 ...
- 七年之痒!一个 PHP 程序员职业生涯的自述
大家好,我是码农先森. 今年刚好是我毕业的第七个年头,在婚姻感情当中都有一种「七年之痒」的说法,这次我把这个词「七年之痒」用一次在我的职业生涯复盘上.七年前我从告别校园,踏入互联网编程行业,七年后我依 ...
- JavaScript 中的 Range 和 Selection 对象
JavaScript 中的 Range 和 Selection 对象 前言 最近在做鼠标框选的需求,鼠标框选就需要用到 Range 和 Selection 对象. Range 表示选择的区间范围,Se ...
- 容器化tomcat9.0
#启动tomcat容器: docker run -d --name tomcat9.0 -p 8080:8080 registry.cn-hangzhou.aliyuncs.com/chenleile ...
- 面试题:两个UILabel横向排列,要求压缩其中一个Label,另外一个Label的内容保持完整
一.题目 AutoLayout中,布局两个UILabel,竖直方向处于统一水平线上:水平方向,二者间隔一定距离,左边的label距离父容器一定间距,右边的label距离容器右侧一定间隔 要求,两个la ...