Git克隆的laravel 5.2项目不会迁移
我从git克隆一个项目。
我运行命令后:
- 作曲家转储自动加载
- 作曲家更新
文件composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"zizaco/entrust": "5.2.x-dev",
"doctrine/dbal": "^2.5",
"intervention/image": "^2.3"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r "copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"IlluminateFoundationComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"IlluminateFoundationComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
文件evn
APP_ENV =本地
APP_DEBUG = true APP_KEY = SomeRandomString
APP_URL = HTTP://本地主机
DB_CONNECTION = MySQL的
DB_HOST = 127.0.0.1 DB_PORT = 3306
DB_DATABASE = wicker_master
DB_USERNAME =根
DB_PASSWORD =根
CACHE_DRIVER =文件
SESSION_DRIVER =文件
QUEUE_DRIVER =同步
REDIS_HOST = 127.0.0.1
REDIS_PASSWORD = NULL
REDIS_PORT = 6379
MAIL_DRIVER = SMTP
MAIL_HOST = mailtrap.io
MAIL_PORT = 2525
MAIL_USERNAME = NULL
MAIL_PASSWORD = NULL
MAIL_ENCRYPTION = NULL
错误:
> IlluminateFoundationComposerScripts::postUpdate
> php artisan optimize
[IlluminateDatabaseQueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wicker_master.about_us' doesn't exist (SQL: select * from `about_us`)
[PDOException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wicker_master.about_us' doesn't exist
Script php artisan optimize handling the post-update-cmd event returned with error code 1
你有.env文件中创建的相同db名称吗?
例如,如果你已经写了
DB_DATABASE=laravel
确保你先创建了名为laravel
数据库