- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 VPS 上安装了 Laravel。我通过 SSH 连接到我的计算机。
“php artisan migrate”命令返回此错误:
Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
我的 .env 文件如下所示:
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:secret
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=redis
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
LARAVEL_ECHO_PORT=6001
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
我的数据库文件如下所示:
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => '{default}',
'retry_after' => 90,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];
这两个都有意义吗?我应该使用本地主机吗? Redis 和 Laravel 位于同一服务器上。我尝试了通常对人们有帮助的方法,例如命令:php artisan 配置:缓存
php artisan 缓存:清除
最佳答案
运行php artisan config:clear
而不是config:cache
或cache:clear
然后php artisan migrate:install
关于Laravel 使用命令 "php artisan migrate"时出现 Illuminate\Database\QueryException (没有此类文件或目录),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61548665/
我正在使用 slim 框架开发一个 Restful 应用程序。我正在使用一个使用 illuminate 数据库的 session 管理器。它要求我使用 Laravel 的 illuminate 实例创
我为一个新项目创建了 Lumen 的全新安装,我正在尝试将 Redis 设置为缓存/ session 驱动程序。通过 Composer ,我能够毫无问题地安装 Predis,然后在尝试运行时: com
在我的独立(没有 Laravel)项目中,我想使用 Illuminate IoC 容器。我还想通过 illuminate/support 组件提供的 App facade 访问应用程序容器。我安装了这
我更新了 composer.json删除illuminate\html并添加: "require": { "laravelcollective/html": "5.1.*" 我从 app.ph
我知道这里有几个类似的问题,但没有一个能解决我的问题。 我正在尝试在 Ubuntu 14.04 上使用 Laravel 5 添加 HtmlServiceProvider。我不断收到以下错误: dl@d
Controller 代码: return redirect()->route('admin.patient.edit', $patientId); 测试代码: $this->visit(route(
我正在尝试开始使用 laravel php 框架。我试图调用索引文件,但收到此错误消息。 C:\xampp\php\php.exe C:\xampp\htdocs\tutorials\lara\app
我有一个使用 OAuth2 执行的 Facebook 登录,然后我使用 Laravel 4 的内置身份验证系统在重新访问时重新登录用户。对于大多数用户,我认为我所拥有的没有任何问题,但对于一位用户,他
我正在使用 smtp 协议(protocol)使用 mailtrap 发送邮件。它在本地主机中运行良好,但出现错误。 Symfony\Component\Debug\Exception\FatalTh
我对 Laravel 还很陌生,我正在尝试将用户创建的帖子添加到数据库中。但是当我这样做时,出现以下错误: Argument 1 passed to Illuminate\Database\Eloqu
我是 laravel 的初学者。我正在使用 guard 进行多重授权。我在我的管理员登录中遇到了这个问题:类型错误Illuminate\Auth\SessionGuard::login():参数 #1
题目地址:https://leetcode.com/problems/available-captures-for-rook/ 题目描述 Ona N x N grid of cells, each
我有一个网络应用程序可以在我的本地计算机上运行,但不能在我的服务器上运行。我在服务器上收到此错误。我检查了错误提到的代码,没有任何问题。 你知道是什么原因造成的吗? 非常感谢您。 这是我的错误信息
我正在我的服务器上安装一个 PHP 脚本作为测试,但我遇到了这个错误。我无法理解脚本代码有什么问题。 我在应用程序上启用 Debug模式并收到此错误消息: Call to undefined func
我尝试获取如下数据数组: $coupons = $user->coupons::where('is_activated_flg', 1)->where('is_used_flg', 0)->lists
我正在将我的 Laravel 从 5.2 升级到 5.3,并且已经阅读了 https://laravel.com/docs/5.3/upgrade 上的文档。 ,但我在运行我的应用程序时仍然收到此消息
Ive Laravel队列正在运行,但是在数据库连接上,这是配置: 'database' => [ 'driver' => 'database', 'connection' => 'm
登录后,我一直在尝试在用户模型中执行方法。据我了解,您执行了以下操作:Auth::user()->foo(); 由于某种原因,这不起作用。 代码 User.php '[email protected
登录后,我一直在尝试在用户模型中执行方法。据我了解,您执行了以下操作:Auth::user()->foo(); 由于某种原因,这不起作用。 代码 User.php '[email protected
我将 Laravel 站点部署到 cPanel 共享主机,并将我的数据库迁移到主机的数据库。当我尝试通过登录密码进入网站时,错误是: Symfony \ Component \ Debug \ Exc
我是一名优秀的程序员,十分优秀!