PHP 项目部署
概述
平台默认会根据源码根目录是否有index.php
文件或者 composer.json
来识别为 PHP 项目.
shell hook 支持
通过配置 composer.json
进行 shell hook 对调用
{
"scripts": {
"pre-install-cmd": ["bash ./pre-install-cmd.sh"],
"post-install-cmd": ["bash ./post-install-cmd.sh"]
},
"require": {
"php": "7.1.21",
"ext-memcached": "*"
}
}
其中 pre-install-cmd
定义内容会在 install 前执行,post-install-cmd
定义内容会在 install 后执行,定义脚本必须提前创建并赋予执行权限
Composer 文件
默认源码根目录需要存在 composer.json
和 composer.lock
文件。composer.lock
其中可以通过如下命令生成
composer update --ignore-platform-reqs
扩展支持
PHP 5.6
在 Rainbond 上自动启用以下内置扩展(此列表不包括默认情况下 PHP 启用的扩展,例如 DOM,JSON,PCRE 或 PDO):
- Bzip2
- cURL
- FPM
- mcrypt
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
以下内置扩展已经构建为“共享”,可以通过 composer.json(括号中给出的内部标识符名称)启用:
- BCMath (
bcmath
) - Calendar (
calendar
) - Exif (
exif
) - FTP (
ftp
) - GD (
gd
; with PNG, JPEG and FreeType support) - GMP (
gmp
) - gettext (
gettext
) - IMAP (
imap
; with SASL and Kerberos support) - intl (
intl
) - LDAP (
ldap
; with SASL support) - mbstring (
mbstring
) - MySQL (
mysql
; note that this extension is deprecated since PHP 5.5, please migrate to MySQLi or PDO) - PCNTL (
pcntl
) - Shmop (
shmop
) - SOAP (
soap
) - SQLite3 (
sqlite3
) - SQLite (PDO) (
pdo_sqlite
) - XMLRPC (
xmlrpc
) - XSL (
xsl
)
可以通过 composer.json 启用以 下第三方扩展(括号中给出的内部标识符名称):
- APCu (
apcu
; provides an apc extension for compatibility with legacy software) - Blackfire (
blackfire
) - Cassandra (
cassandra
) - ev (
ev
) - event (
event
) - ImageMagick (
imagick
) - memcached (
memcached
; built against a version of libmemcached with SASL support) - Mongo (
mongo
) - MongoDB (
mongodb
) - New Relic (
newrelic
; will automatically be enabled when the New Relic Add-On is detected during a build) - OAuth (
oauth
) - Phalcon (
phalcon
) - pq (
pq
) - rdkafka (
rdkafka
) - PHPRedis (
redis
)
PHP 7.0
在 Rainbond 上自动启用以下内置扩展(此列表不包括默认情况下 PHP 启用的扩展,例如 DOM,JSON,PCRE 或 PDO):
- Bzip2
- cURL
- FPM
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
以下内置扩展已经构建为“共享”,可以通过 composer.json(括号中给出的内部标识符名称)启用:
- BCMath (
bcmath
) - Calendar (
calendar
) - Exif (
exif
) - FTP (
ftp
) - GD (
gd
; with PNG, JPEG and FreeType support) - GMP (
gmp
) - gettext (
gettext
) - IMAP (
imap
; with SASL and Kerberos support) - intl (
intl
) - LDAP (
ldap
; with SASL support) - mbstring (
mbstring
) - mcrypt (
mcrypt
) - PCNTL (
pcntl
) - Shmop (
shmop
) - SOAP (
soap
) - SQLite3 (
sqlite3
) - SQLite (PDO) (
pdo_sqlite
) - XMLRPC (
xmlrpc
) - XSL (
xsl
)
可以通过 composer.json 启用以下第三方扩展(括号中给出的内部标识符名称):
- APCu (
apcu
; provides an apc extension for compatibility with legacy software) - Blackfire (
blackfire
) - Cassandra (
cassandra
) - ev (
ev
) - event (
event
) - ImageMagick (
imagick
) - memcached (
memcached
; built against a version of libmemcached with SASL support) - MongoDB (
mongodb
) - New Relic (
newrelic
; will automatically be enabled when the New Relic Add-On is detected during a build) - OAuth (
oauth
) - Phalcon (
phalcon
) - pq (
pq
) - rdkafka (
rdkafka
) - PHPRedis (
redis
)
PHP 7.1
在 Rainbond 上自动启用以下内置扩展(此列表不包括默认情况下 PHP 启用的扩展,例如 DOM,JSON,PCRE 或 PDO):
- Bzip2
- cURL
- FPM
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
以下内置扩展已经构建为“共享”,可以通过 composer.json(括号中给出的内部标识符名称)启用:
- BCMath (
bcmath
) - Calendar (
calendar
) - Exif (
exif
) - FTP (
ftp
) - GD (
gd
; with PNG, JPEG and FreeType support) - GMP (
gmp
) - gettext (
gettext
) - IMAP (
imap
; with SASL and Kerberos support) - intl (
intl
) - LDAP (
ldap
; with SASL support) - mbstring (
mbstring
) - mcrypt (
mcrypt
) - PCNTL (
pcntl
) - Shmop (
shmop
) - SOAP (
soap
) - SQLite3 (
sqlite3
) - SQLite (PDO) (
pdo_sqlite
) - XMLRPC (
xmlrpc
) - XSL (
xsl
)
可以通过 composer.json 启用以下第三方扩展(括号中给出的内部标识符名称):
- APCu (
apcu
; provides an apc extension for compatibility with legacy software) - Blackfire (
blackfire
) - Cassandra (
cassandra
) - ev (
ev
) - event (
event
) - ImageMagick (
imagick
) - memcached (
memcached
; built against a version of libmemcached with SASL support) - MongoDB (
mongodb
) - New Relic (
newrelic
; will automatically be enabled when the New Relic Add-On is detected during a build) - OAuth (
oauth
) - Phalcon (
phalcon
) - pq (
pq
) - rdkafka (
rdkafka
) - PHPRedis (
redis
)
部署示例
进入到团队下,新建应用选择基于源码示例进行构建,选中 PHP Demo 并默认全部下一步即可。