简体   繁体   English

如何安装和配置现有的 Laravel 项目? (拉维尔 4)

[英]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 updatecomposer 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 要安装和配置现有项目,通常是这样

  1. Check out its source code 查看其源代码

  2. Run composer install 运行composer install

  3. Run php artisan migrate 运行php artisan migrate

  4. 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 : 要安装和配置现有项目,通常首先检查这些事项:

  1. You should goto app/config/database.php check file and verify username and password. 您应该转到app/config/database.php检查文件并验证用户名和密码。
  2. After check in Project Folder vendor folder and composer.json file exist then remove it (that remove old configuration now we going to fresh configuration). 检查项目文件夹vendor文件夹和composer.json文件后,然后将其删除(删除旧配置现在我们将进行全新配置)。
  3. Then after back to command prompt and fire command composer update and that download some dependent file download. 然后回到命令提示符和fire命令组合器composer update并下载一些依赖文件下载。
  4. Now Run 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.

相关问题 如何将 Laravel/Artisan 安装到现有的 Laravel 项目中? - How do I install Laravel/Artisan into an existing Laravel project? 为现有的 laravel 项目安装 Jetstream 是否安全? - Is it safe to install jetstream for an existing laravel project? 如何在Laravel中扩展现有的外墙? - How can I extend an existing facade in Laravel? 我如何摆脱下面提到的错误并使用homestead为第一个Laravel项目配置作曲家 - How can I get rid of error mentioned below and configure composer for first Laravel project using homestead 如何在 laravel 中安装 PHPExcel 库? - How I can install the PHPExcel library in laravel? Laravel-Lumen:如何将 laravel 支持的以下包安装到有助于调试 api 日志的 lumen 项目包中? - Laravel-Lumen: How can i install the following package that is supported in laravel to a lumen project package that can helps in debugging api logs? 如何在 Laravel 项目中安装 PHPunit - How to install PHPunit in a Laravel project 如何安装 Laravel 项目的依赖项? - how to install dependencies of a Laravel project? 如何组织laravel项目的github存储库,以便用户轻松安装和运行它? - How can I organize my laravel project's github repository so that users can easily install and run it? 我可以在服务器的子目录中安装Laravel项目吗? - Can I install a Laravel project in a subdirectory of my server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM