lumen

lumen生成key

匿名 (未验证) 提交于 2019-12-03 00:13:02
在 Lumen 控制台运行 php artisan key:generate 提示: $ php artisan key : generate [ Symfony \Component\Console\Exception\CommandNotFoundException ] There are no commands defined in the "key" namespace . PHP 原因是 Lumen 本身并不带 Laravel 的 comsole key 命令。 其实 APP_KEY 就是一个32位随机字符串,那么我们可以通过写 router 来实现生成 APP_KEY 在 Lumen 的 routes/web.php 写路由命令: // 生成APP_KEY $app -> get ( '/key' , function () { return str_random ( 32 ); }); PHP 注意: Lumen5.5 中 $app 需要换成 $router 。 然后将访问路由地址拿到的32位随机密码放在 .env 的 APP_KEY 就可以了。 来源:博客园 作者: brady.wang 链接:https://www.cnblogs.com/php-linux/p/11626475.html

lumen安装踩过得坑

别等时光非礼了梦想. 提交于 2019-12-02 22:30:50
问题一 php和Apache模块和拓展的开启问题 Apache要开启rewrite模块 PHP开启OpenSSL拓展 注意单纯的打开这个拓展是没有用的 ,解决问题请参考 https://blog.csdn.net/michaelzhouh/article/details/86135727 安装的话请参考官方手册 这里就不做解释 问题二 虚拟站点的配置问题 因为以前新建过很多站点 ,有点思维定式 直接就是复制以前的站点 lumen在入口文件目录下有个.htaccess文件直接访问会报403 删除该文件则除了根目录访问其他目录会报404 应该在虚拟站点中 设置为 来源: https://www.cnblogs.com/mofei12138/p/11764992.html

Laravel Lumen Memcached not found

房东的猫 提交于 2019-12-02 17:37:21
Ok, I just started with Lumen and I'm trying to use the Auth, but a call to either Auth::check or any other function of Auth.. leads to the below Error Fatal error: Class 'Memcached' not found in vendor\illuminate\cache\MemcachedConnector.php on line 52 . I don't want to use Memcached never used it before. I disabled it in the .env file and set the CACHE_DRIVER and SESSION_DRIVER to array, but still shows the same error. I decided not to use Auth again and to manually handle my authetication with sessions/tokens, but enabling the MiddleWare StartSession results to the same error. $app-

Lumen Micro Framework => php artisan key:generate

别等时光非礼了梦想. 提交于 2019-12-02 14:16:55
I'm trying out the PHP micro Framework Lumen (from Laravel). One of my first steps was to look into the .env.example file and make a copy of it to have my .env file. There is a variable APP_KEY just like there is in Laravel. Now I tried out the simple command php artisan key:generate to get my new key But I ran into the following error message: [InvalidArgumentException] There are no commands defined in the "key" namespace. Does some one know how I can generate keys for Lumen? Update with solution So I found my favorite solution for this problem. On the command line (Linux) I run php -r "echo

Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null

痴心易碎 提交于 2019-12-02 11:06:39
问题 Hi I got this errors in Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null in RedirectResponse.php line 75 at Application->handleShutdown() in RegistersExceptionHandlers.php line 55 at Application->Laravel\Lumen\Concerns{closure}() Here the code which throws the error: return redirect('formular') ->withErrors($validator) ->withInput(); The error comes from withInput() 回答1: The error is happening because Lumen 5.2 does not support sessions

Lumen Daily Logs

独自空忆成欢 提交于 2019-12-02 04:59:57
问题 I want to add to my Lumen project a daily Log. I try this in the app.php (Folder Bootstrap/) $logFile = 'laravel.log'; Log::useDailyFiles(storage_path().'/logs/'.$logFile); But this set me that error Call to undefined method Monolog\logger::useDailyFiles() Any help I appreciate...Thanks 回答1: If you look at the framework source code here you can see that it will not do daily logs, but rather write to a single log file lumen.log . There is a public method available configureMonologUsing seen

Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null

拥有回忆 提交于 2019-12-02 03:10:42
Hi I got this errors in Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null in RedirectResponse.php line 75 at Application->handleShutdown() in RegistersExceptionHandlers.php line 55 at Application->Laravel\Lumen\Concerns{closure}() Here the code which throws the error: return redirect('formular') ->withErrors($validator) ->withInput(); The error comes from withInput() The error is happening because Lumen 5.2 does not support sessions. The withErrors() and withInput() methods attempt to set values on the session attribute on the redirector,

使用laravel-wechat微信支付

混江龙づ霸主 提交于 2019-12-01 19:39:40
参考文档 https://github.com/overtrue/laravel-wechat https://easywechat.com/docs/4.1/payment/index laravel-wechat 微信 SDK for Laravel 5 / Lumen, 基于 overtrue/wechat 交流QQ群:319502940 框架要求 Laravel/Lumen >= 5.1 安装 # Laravel < 5.8 composer require "overtrue/laravel-wechat:~4.0" # Laravel >= 5.8 composer require "overtrue/laravel-wechat:~5.0" 配置 Laravel 应用 在 config/app.php 注册 ServiceProvider 和 Facade (Laravel 5.5 + 无需手动注册) 'providers' => [ // ... Overtrue\LaravelWeChat\ServiceProvider::class, ], 'aliases' => [ // ... 'EasyWeChat' => Overtrue\LaravelWeChat\Facade::class, ], 创建配置文件: php artisan vendor

Laravel API connecting to multiple databases

孤街醉人 提交于 2019-12-01 10:53:04
I'm building a REST API with Laravel (Lumen). The idea is that this API provides the back-end for multiple food-ordering websites. They share the same back-end logic (models, controllers etc.). This way each website only needs it's own front-end application, I'm planning to use Angular for this. Each website will have it's own data (products, pages etc.), which has to be stored in different databases. I've defined multiple connections within config/databases.php for testing purposes. Now I can dynamically set the connection before querying the corresponding database, like this: class

Laravel API connecting to multiple databases

拜拜、爱过 提交于 2019-12-01 07:28:54
问题 I'm building a REST API with Laravel (Lumen). The idea is that this API provides the back-end for multiple food-ordering websites. They share the same back-end logic (models, controllers etc.). This way each website only needs it's own front-end application, I'm planning to use Angular for this. Each website will have it's own data (products, pages etc.), which has to be stored in different databases. I've defined multiple connections within config/databases.php for testing purposes. Now I