PHP Project Deployment
Overview
The platform defaults to recognizing PHP projects based on the presence of an index.php
file or composer.json
in the root directory of the source code.
Shell Hook Support
Configure composer.json
to call shell hooks
{
"scripts": {
"pre-install-cmd": ["bash ./pre-install-cmd.sh"],
"post-install-cmd": ["bash ./post-install-cmd.sh"]
},
"require": {
"php": "7.1.21",
"ext-memcached": "*"
}
}
The content defined in pre-install-cmd
will be executed before install, and the content defined in post-install-cmd
will be executed after install. The defined scripts must be created in advance and given execute permissions
Composer Files
By default, the composer.json
and composer.lock
files must exist in the root directory of the source code.composer.lock
can be generated with the following command
composer update --ignore-platform-reqs
Extension Support
PHP 5.6
The following built-in extensions are automatically enabled on Rainbond (this list does not include extensions enabled by default in PHP, such as DOM, JSON, PCRE, or PDO):
- Bzip2
- cURL
- FPM
- mcrypt
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
The following built-in extensions have been built as "shared" and can be enabled via composer.json (the internal identifier name is given in parentheses):
- 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
)
The following third-party extensions can be enabled via composer.json (the internal identifier name is given in parentheses):
- 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
The following built-in extensions are automatically enabled on Rainbond (this list does not include extensions enabled by default in PHP, such as DOM, JSON, PCRE, or PDO):
- Bzip2
- cURL
- FPM
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
The following built-in extensions have been built as "shared" and can be enabled via composer.json (internal identifier names given in parentheses):
- 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
)
The following third-party extensions can be enabled via composer.json (internal identifier names given in parentheses):
- 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
The following built-in extensions are automatically enabled on Rainbond (this list does not include extensions enabled by default in PHP, such as DOM, JSON, PCRE or PDO):
- Bzip2
- cURL
- FPM
- MySQL (PDO) (uses mysqlnd)
- MySQLi (uses mysqlnd)
- OPcache
- OpenSSL
- PostgreSQL
- PostgreSQL (PDO)
- Readline
- Sockets
- Zip
- Zlib
The following built-in extensions have been built as "shared" and can be enabled via composer.json (internal identifier names given in parentheses):
- 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
)
The following third-party extensions can be enabled via composer.json (the internal identifier name is given in parentheses):
- 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
)
Deployment example
Go to the team, create a new application and select the source code example for construction, select PHP Demo and default all the next steps.