2018-10-15 10:59
浏览 86

从一个Laravel安装到另一个运行php artisan

We have a Laravel deployment website set up under deploy.mysite.com which handles deployments for a multitude of other websites.

One other website I'm trying to deploy which is also a Laravel site resides under site2.myothersite.com.

Both are on the same server. Deploy calls a script on site2, this deploy script runs various commands after cd'ing to the project directory. We use the following to update the database structure.

php artisan migrate --force

Ordinarily when this is run directly via SSH when in the project root, it runs just fine.

However when this is run via the deployment script (using php exec() to run these commands) the process does work - however, instead of updating the project that we've cd'd into, it updates the database structure of the deployment site!

It seems as if the php artisan migrate command ignores the fact I've cd'd into another project and it takes the database values from the current directory.

How can I go about changing this behaviour?

图片转代码服务由CSDN问答提供 功能建议

我们在 deploy.mysite.com 下设置了一个Laravel部署网站,用于处理部署 对于众多其他网站。

我正在尝试部署的另一个网站也是Laravel网站,位于 site2.myothersite.com 下。

两者都在同一台服务器上。 部署在site2上调用脚本,此部署脚本在 cd 之后运行各种命令到项目目录。 我们使用以下命令更新数据库结构。

  php artisan migrate --force 

通常情况下 在项目根目录中直接通过SSH运行,它运行得很好。

但是当通过部署脚本(使用php exec()运行时) 运行这些命令)该过程确实有效 - 但是,而不是更新我们 cd '的项目,它会更新部署站点的数据库结构! < / p>

似乎 php artisan migrate 命令忽略了我 cd 'd进入另一个项目的事实并且它需要数据库 来自当前目录的值。


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题