• 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 [IlluminateContractsHttpKernel] 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(IlluminateContractsHttpKernel::class);
    
    $response = $kernel->handle(
        $request = IlluminateHttpRequest::capture()
    );
    
    $response->send();
    
    $kernel->terminate($request, $response);
    

    是这一句放到lumen里面就错了

    $kernel = $app->make(IlluminateContractsHttpKernel::class);
    

    把lumen的index.php拷过来就行了

  • 相关阅读:
    mac 版 Pycharm 激活
    最快的 maven repository--阿里镜像仓库
    java-Object
    java --replaceAll方法
    正则表达式中^[a-z]与[^a-z]有区别吗
    keyListener用的健值表,保留一份
    java播放背景音乐 mp3和mav都可以播放
    腾讯云ubuntu远程桌面
    nginx 配置转发到其他多台服务器
    java 键盘监听事件
  • 原文地址:https://www.cnblogs.com/HappyTeemo/p/15396937.html
Copyright © 2020-2023  润新知