百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

ftp-deployment

> 编程语言
开源

一个用于将 Web 应用程序自动部署到 FTP 服务器的工具。

617 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于将 Web 应用程序自动部署到 FTP 服务器的工具。

FTP Deployment: smart upload

FTP deployment is a tool for automated deployment to an FTP server.

There is nothing worse than uploading web applications to FTP server manually, using tools like Total Commander. (Although, editing files directly on the server and then trying to keep some kind of synchronization is even worse ;-)

Once the process is automated, it costs you a fraction of time and minimizes the risk of error (didn't I forget to upload some files?). There are lots of sophisticated deploying techniques available today, but many people are still using FTP. This tool is designed for them.

Support Me

Do you like FTP Deployment? Are you looking forward to the new features? Thank you!

How it Works

FTP Deployment is a script written in PHP and will automate the entire process. Just say which local folder to upload and where. This information is stored in a deployment.ini text file, which you can associate with deployment script, so deployment will become a one click thing.

php deployment deployment.ini

And what does the deployment.ini file contain? Only the remote item is required, all the others are optional:

…

In the config file you can create multiple sections (like [my site]), so you may have separate rules for data and for application.

Configuration can also be stored in a PHP file.

In test mode (with -t option) uploading or deleting files is skipped, so you can use it to verify your settings.

Item ignore uses the similar format to .gitignore:

log - ignore all 'log' files or directories in all subfolders
/log - ignore 'log' file or directory in the root
app/log - ignore 'log' file or directory in the 'app' in the root
data/* - ignore everything inside the 'data' folder, but the folder will be created on FTP
!data/db/file.sdb - make an exception for the previous rule and do not ignore file 'file.sdb'
project.pp[jx] - ignore files or folders 'project.ppj' and 'project.ppx'

Before the upload starts, after it finishes and after all jobs, you can execute commands or call your scripts on the server (see before, afterUpload, after), which can, for example, switch the server to a maintenance mode. If you use PHP config, you can run lambda function with deployment environment:

php
 'ftp://user:[email protected]/directory',
	'local' => '.',
	'before' => [
		function (Deployment\Server $server, Deployment\Logger $logger, Deployment\Deployer $deployer) {
			... do something
		},
	],
	...
];

Syncing a large number of files attempts to run in (something like) a transaction: all files are uploaded with extension .deploytmp and then quickly renamed.

You can press Ctrl+C at any time during deployment. An interactive prompt will appear with three choices: [s]kip the current operation and continue with the next one, [r]esume to ignore the interruption, or [c]ancel the entire deployment. Skipped operations are reported at the end. Temporary files are always cleaned up, and the deployment file on the server is kept consistent even when operations are skipped. In non-interactive environments (CI/CD), Ctrl+C terminates immediately.

An .htdeployment file is uploaded to the server, which contains MD5 hashes of all the files and is used for synchronization. So the next time you run deployment, only modified files are uploaded and deleted files are deleted from server (if it is not forbidden by the allowDelete directive).

Uploaded files can be processed by a preprocessor. These rules are predefined: .css files are compressed using the clean-css and .js are minified by UglifyJS or UglifyES (both via Node.js tool).

There is also a rule for expanding mod_include Apache directives. For example, you can create a file combined.js:

This tool will combine scripts together and minify them with the Closure Compiler to speed-up your website.

Installing FTP Deployment

FTP Deployment requires PHP 8.2 or later. It also requires openssl extensions for ftps:// and SSH2 extension for sftp:// connections.

The easiest way to obtain FTP Deployment is to download a single PHAR file.

If you want to use minification, install Node.js, UglifyJS 3 for JavaScript minification and clean-css for CSS minification.

bash
npm install uglify-js -g
npm install clean-css-cli -g

Or you can install it using Composer:

composer create-project dg/ftp-deployment

Are you looking for php_ssh2.dll?

  • php_ssh2.dll for PHP 8.0 x64
  • php_ssh2.dll for PHP 8.1 x64
  • php_ssh2.dll for PHP 8.2 x64

Need SSH authenticate using a public key?

publicKey = '/key/id_rsa.pub'
privateKey = '/key/id_rsa'
passPhrase = 'yourpass' #optional - If needed passphrase for privateKey

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPftpphpsshsynchronization

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言