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 .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() 查询时 ...
- 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来实现一个完整的用 ...
- 关于Laravel框架中Guard的底层实现
1. 什么是Guard 在Laravel/Lumen框架中,用户的登录/注册的认证基本都已经封装好了,开箱即用.而登录/注册认证的核心就是: 用户的注册信息存入数据库(登记) 从数据库中读取数据和用户 ...
- lumen Rest API 起步
lumen Rest API 起步 修改项目文件 .env DB_DATABASE=<数据库名> DB_USERNAME=<数据库用户名> DB_PASSWORD=<数据 ...
随机推荐
- (数据科学学习手札128)在matplotlib中添加富文本的最佳方式
本文示例代码及文件已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 长久以来,在使用matplotlib进行绘 ...
- mybatis关系表
<select id="selectSingleQuestion" resultType="remarkPaper"> select FrontTi ...
- Visual Studio 6.0 在 Windows 10 下崩溃的一种解决方法
Visual Studio 6.0 下载地址: https://winworldpc.com/product/microsoft-visual-stu/60 安装步骤: https://www.cod ...
- Winform 空闲时间(鼠标键盘无操作)
前言 Winform 在特定情况下,需要判断软件空闲时间(鼠标键盘无操作),然后在做一下一些操作. 实现 做了一个简单的例子,新建一个窗体,然后拖两个控件(Timer控件和label控件) using ...
- 【C++ Primer Plus】编程练习答案——第7章
1 double ch7_1_harmonicaverage(double a, double b) { 2 return 2 / (1 / a + 1 / b); 3 } 4 5 void ch7_ ...
- Incorrect datetime value: 时间添加失败原因
在进行单元测试中通过 new Date() 方式添加时间时,报了 Data truncation: Incorrect datetime value:这样的错误(我数据库表的时间类型是 datetim ...
- Spring源码阅读一
引导: 众所周知,阅读spring源码最开始的就是去了解spring bean的生命周期:bean的生命周期是怎么样的呢,见图知意: 大致流程: 首先后通过BeanDefinitionReader读取 ...
- S_型文法到q_型文法再到LL(1)型文法演进笔记
title: S_型文法到q_型文法再到LL(1)型文法演进笔记 date: 2020-08-23 S_型文法到q_型文法再到LL(1)型文法演进笔记 S_型文法(简单的确定性文法) 每个产生式的右部 ...
- Java到底怎么学?
你现在是不是想学Java,但很迷茫不知该从何下手,那么请认真看完这篇文章,希望对你有所帮助! 作为零基础刚刚接触Java的朋友们来说,我的建议还是先看视频,虽然有很多人说看视频学习慢,建议直接买优秀的 ...
- wqs二分 学习笔记
wqs二分学习笔记 wqs二分适用题目及理论分析 wqs二分可以用来解决这类题目: 给你一个强制要求,例如必须\(n\)条白边,或者划分成\(n\)段之类的,然后让你求出最大(小)值.但是需要满足图像 ...