如何开始从 subversion 存储库部署 PHP 应用程序?

2023-05-07php开发问题
2

本文介绍了如何开始从 subversion 存储库部署 PHP 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我听说过部署应用程序"这句话,听起来比将单个更改的文件上传到服务器要好/容易/可靠得多,但我不知道从哪里开始.

I've heard the phrase "deploying applications" which sounds much better/easier/more reliable than uploading individual changed files to a server, but I don't know where to begin.

我有一个受版本控制的 Zend Framework 应用程序(在 Subversion 存储库中).我该如何部署"我的应用程序?如果我有一个不想覆盖的上传"目录,我该怎么办?

I have a Zend Framework application that is under version control (in a Subversion repository). How do I go about "deploying" my application? What should I do if I have an "uploads" directory that I don't want to overwrite?

我通过第三方托管我的应用程序,所以除了 FTP 之外我一无所知.如果其中任何一项涉及登录我的服务器,请解释该过程.

I host my application through a third party, so I don't know much other than FTP. If any of this involves logging into my server, please explain the process.

推荐答案

自动部署 + 运行测试到临时服务器被称为持续集成.这个想法是,如果您签入破坏测试的内容,您会立即收到通知.对于 PHP,您可能需要查看 Xinc 或 phpUnderControl

Automatic deploy + run of tests to a staging server is known as continuous integration. The idea is that if you check in something that breaks the tests, you would get notified right away. For PHP, you might want to look into Xinc or phpUnderControl

您通常想要自动部署到生产环境.正常的做法是编写一些脚本来自动执行任务,但您仍然需要手动启动.您可以为此使用诸如 Phing 之类的框架或其他构建工具(一种流行的选择是 Capistrano),但您也可以将几个 shell 脚本混合在一起.我个人更喜欢后者.

You'd generally not want to automatically deploy to production though. The normal thing to do is to write some scripts that automates the task, but that you still need to manually initiate. You can use frameworks such as Phing or other build-tools for this (A popular choice is Capistrano), but you can also just whisk a few shell-scripts together. Personally I prefer the latter.

脚本本身可以做不同的事情,这取决于您的应用程序和设置,但一个典型的过程是:

The scripts themselves could do different things, depending on your application and setup, but a typical process would be:

  • ssh 到生产服务器.其余命令通过 ssh 在生产服务器上运行.
  • 运行 svn export svn://path/to/repository/tags/RELEASE_VERSION/usr/local/application/releases/TIMESTAMP
  • 停止服务(Apache、守护进程)
  • run unlink/usr/local/application/current &&ln -s/usr/local/application/releases/TIMESTAMP/usr/local/application/current
  • 运行 ln -s/usr/local/application/var/usr/local/application/releases/TIMESTAMP/var
  • 运行/usr/local/application/current/scripts/migrate.php
  • 启动服务

(假设您的应用程序位于 /usr/local/application/current)

(Assuming you have your application in /usr/local/application/current)

这篇关于如何开始从 subversion 存储库部署 PHP 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

PHP实现DeepL翻译API调用
DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以...
2025-08-20 php开发问题
168

PHP通过phpspreadsheet导入Excel日期数据处理方法
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的...
2024-10-23 php开发问题
287

mediatemple - 无法使用 codeigniter 发送电子邮件
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)...
2024-08-23 php开发问题
11

Laravel Gmail 配置错误
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)...
2024-08-23 php开发问题
16

将 PHPMailer 用于 SMTP 的问题
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)...
2024-08-23 php开发问题
4

关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)...
2024-08-23 php开发问题
17