[英]How I can install and configure an existing Laravel Project? (Laravel 4)
I need to install and configure an existing Laravel 4 project.我需要安装和配置现有的 Laravel 4 项目。
I tried to do, but when I ran composer update
or composer install
a lot of issues appear.我尝试这样做,但是当我运行
composer update
或composer install
时出现了很多问题。
I have the database too (with data) so I ran the migration but doesn't work because the console show me an issue about the "table doesn't exist".我也有数据库(带有数据),所以我运行了迁移但不起作用,因为控制台向我显示有关“表不存在”的问题。
Can anyone tell me the complete process to configure the App?.谁能告诉我配置应用程序的完整过程?
I mean, what its first, second and so and so because maybe in some step I made a mistake我的意思是,它是第一个,第二个等等,因为也许在某些步骤中我犯了错误
To install and configure an existing project, you'd typically 要安装和配置现有项目,通常是这样
Check out its source code 查看其源代码
Run composer install
运行
composer install
Run php artisan migrate
运行
php artisan migrate
Check the README
for specific instructions on installing 3rd party assets, or any additional steps you'd need to take 有关安装第三方资产的具体说明或您需要执行的任何其他步骤,请查看
README
If the above creates errors, its either because of something in your environment (installing over an old project?) or some problem with the way the Laravel developer created their project. 如果上面创建错误,可能是因为环境中的某些东西(在旧项目上安装?)或者Laravel开发人员创建项目的方式有些问题。
Carlos, when using an existing DB you'll need to check the migrations table to see which migrations have run successfully. Carlos,在使用现有数据库时,您需要检查迁移表以查看哪些迁移已成功运行。 Typically when taking over a laravel project setting up a new db and running the migrations against it is a good idea because you never know what hacks were made to the database outside the migration system.
通常,当接管一个laravel项目时,设置一个新的数据库并运行迁移是一个好主意,因为你永远不知道在迁移系统之外对数据库进行了哪些黑客攻击。 One small change can throw the entire system into a useless state because it's looking for a table or column that doesn't exist or has been modified.
一个小的改变可能会使整个系统陷入无用状态,因为它正在寻找一个不存在或已被修改的表或列。 If you run the migrations against a bare db you can also figure out which tables were manually created (which could very well be your issue) outside the system and add them in as necessary.
如果针对裸db运行迁移,您还可以确定在系统外部手动创建哪些表(这可能是您的问题)并根据需要添加它们。 Cobbling things together after a previous developer is tedious, hopefully there is decent documentation.
在之前的开发人员繁琐之后将事情拼凑在一起,希望有很好的文档。
To install and configure an existing project, you'd typically check those things first : 要安装和配置现有项目,通常首先检查这些事项:
app/config/database.php
check file and verify username and password. app/config/database.php
检查文件并验证用户名和密码。 vendor
folder and composer.json
file exist then remove it (that remove old configuration now we going to fresh configuration). vendor
文件夹和composer.json
文件后,然后将其删除(删除旧配置现在我们将进行全新配置)。 composer update
and that download some dependent file download. composer update
并下载一些依赖文件下载。 php artisan serve
php artisan serve
that tricks work for me last time when I migrate another host. 当我迁移另一个主机时,这个技巧上次为我工作。
Note that if you are using Git with .gitignore
, don't forget to copy .env
variables in new location too.请注意,如果您将 Git 与
.gitignore
一起使用,请不要忘记将.env
变量也复制到新位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.