All Products
Search
Document Center

Serverless App Engine:Deploy an application using a code package

Last Updated:Jul 28, 2025

When deploying an application using a code package, Serverless App Engine (SAE) supports the following technology stacks and runtime environments. Before deployment, you need to create a code package that meets SAE requirements. If your technology stack language and runtime environment are not listed below, you need to deploy an application using an image.

Java

Runtime environment

Update time

JDK version

Operating system version

Open source

Maintained

Description

Dragonwell 21

2024-07-18

21.0.3.0.3+9

CentOS Linux release 7.9.2009

Yes

Yes

Open source Dragonwell 21

Dragonwell 17

2022-07-11

17.0.3.0.3+7

CentOS Linux release 7.9.2009

Yes

Yes

Open source Dragonwell 17

Dragonwell 11

2021-08-27

11.0.10.10-AJDK

CentOS Linux release 7.9.2009

No

Yes

  • Updated Dragonwell and OpenJDK.

  • Updated the operating system.

  • Added support for Chinese and English fonts.

  • Significantly optimized the startup speed.

2020-09-27

Open source Dragonwell 11

Dragonwell 8

2021-10-18

1.8.0_302

CentOS Linux release 7.9.2009

Yes

Yes

Fixed the occasional issue of high CPU utilization.

2021-08-27

  • Updated Dragonwell and OpenJDK.

  • Updated the operating system.

  • Added support for Chinese and English fonts.

  • Significantly optimized the startup speed.

2020-09-27

Enabled features such as Wisp coroutine and self-check of compatibility with the NIO client Netty. For more information, see Open source Dragonwell 8.

OpenJDK 8

2019-06-19

1.8.0_191

CentOS Linux release 7.6.1810

Yes

No

None

OpenJDK 7

2019-02-25

1.7.0_201

CentOS Linux release 7.6.1810

Yes

No

None

openjdk-8u191-jdk-alpine3.9

2019-02-25

1.8.0_191

alpine 3.9.2

Yes

No

Some commands in the alpine image are different from those in CentOS. For example:

  • telnet: The telnet command in the alpine image does not support the -e parameter.

  • curl

  • wget

openjdk-7u201-jdk-alpine3.9

2019-02-25

1.7.0_201

alpine 3.9.2

Yes

No

Some commands in the alpine image are different from those in CentOS. For example:

  • telnet: The telnet command in the alpine image does not support the -e parameter.

  • curl

  • wget

PHP

Runtime introduction

Online applications: NGINX with PHP-FPM

SAE provides a LNMP (Linux+NGINX+MySQL+PHP) runtime environment for PHP web applications, which includes:

  • The default base image of PHP FastCGI Process Manager (FPM).

  • NGINX.

  • Common PHP extensions.

If your application requires more resources, you can use the following Alibaba Cloud services:

Application monitoring: ARMS

For SAE applications with PHP versions 5.4 to 7.3, you can enable application monitoring to obtain more detailed monitoring information such as application call chain tracing and resource access latency for ApsaraDB RDS MySQL and Tair (Redis OSS-compatible).For more information, see ARMS application monitoring overview.

PHP runtime description

Software versions

The following table describes the available PHP runtime environments. If you need a higher version of PHP environment, please join the DingTalk group (Group number: 32874633) to consult with product technical experts.

Runtime environment

Update time

PHP version

NGINX version

Operating system version

Description

PHP-FPM 7.3

2021-12-27

7.3.32

1.18.0

Debian 11.0

  • Supports preset fonts.

  • Supports default PHP extensions.

  • Supports the PHP extension repository PECL.

PHP-FPM 7.2

2021-09-17

7.2.34

1.18.0

Debian 10.7

None

PHP-FPM 7.1

2021-09-17

7.1.33

1.18.0

Debian 10.2

None

PHP-FPM 7.0

2021-09-17

7.0.33

1.18.0

Debian 9.6

None

PHP-FPM 5.6

2021-09-17

5.6.40

1.18.0

Debian 9.6

None

PHP-FPM 5.5

2021-09-17

5.5.38

1.18.0

Debian 8.5

None

PHP-FPM 5.4

2021-09-17

5.4.45

1.18.0

Debian 8.2

None

System directories

The SAE PHP environment uses the following directories by default for application package deployment:

Type

Path

Description

Directory

/home/admin/app/

The default directory in which application packages are deployed.

Directory

/home/admin/app/nginx/

  • The default NGINX site directory, which corresponds to the ./nginx/ directory in the demo package.

  • Supports NGINX server {} configuration. For more information, see ngx_http_core_module.

Directory

/home/admin/app/php/

The default PHP application directory, which corresponds to the ./php/ directory in the demo package.

File

/usr/local/etc/php.ini

The recommended php.ini configuration path for SAE.

The following table describes the default configurations of PHP-FPM:

Type

Path

Description

Directory

/usr/local/etc/php

PHP_INI_DIR.

Directory

/usr/local/etc/php/conf.d/

The directory in which the PHP extensions are stored. By default, the extensions are included in .ini files.

File

/usr/local/etc/php-fpm.conf

The default configuration file for PHP-FPM. For more information, see FastCGI Process Manager (FPM). For information about how to modify the configuration, see Manage and use configuration items (K8s ConfigMap).

The following table describes the default configurations of NGINX:

Type

Path

Description

File

/usr/sbin/nginx

The directory of NGINX.

Directory

/etc/nginx/

The directory of default NGINX configurations.

File

/etc/nginx/nginx.conf

The default NGINX configuration file nginx.conf, which includes the http {} configuration. By default, the http {} configuration references the /home/admin/app/nginx/ configuration. For information about how to modify the configuration, see Manage and use configuration items (K8s ConfigMap).

Built-in extensions

The PHP environment provided by SAE supports the following extensions:

Related permissions

By default, PHP-FPM and NGINX use the www-data user to run applications. The following table describes the permissions.

Service

Permission USER GROUP

Description

PHP-FPM

Process

www-data www-data

PHP default, the configuration file path is /usr/local/etc/php-fpm.conf.

NGINX

Process

www-data www-data

NGINX default, the configuration file path is /etc/nginx/nginx.conf.

File directory

Directory

root root

The directory in which code packages are deployed, the configuration directory is /home/admin/app/. See the following example:

drwxrwxrwx 2 root root 4096 May 13  2021 nginx
drwxrwxrwx 1 root root 4096 Apr  8 11:45 php
Important

We recommend that you retain the user to prevent application failures.

PHP extension support

Default and PECL extensions

You can configure the php.ini file to specify built-in extensions when you deploy an application, including the default PHP extensions and PECL extensions.

Run the following command in the webshell to view the built-in extensions. For information about how to open the webshell, see View the webshell.

php -m

Examples of built-in extensions supported by different runtime environments:

PECL 7.3

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
mcrypt
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 7.2

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
mcrypt
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 7.1

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
mcrypt
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 7.0

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 5.6

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 5.5

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

PECL 5.4

[PHP Modules]
amqp
ARMS
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
igbinary
imagick
json
libxml
mbstring
memcached
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
recode
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
swoole
sysvmsg
sysvsem
sysvshm
timezonedb
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
yaml
zip
zlib

[Zend Modules]
Xdebug

Install extensions through the console and API

You can enable default PHP extensions or install specific versions of PECL extensions through the SAE console or API. For more information, see Deploy a PHP application.

Install third-party extensions

This section describes how to install a third-party extension by compiling the YAML file that contains the source code in PHP-FPM 7.3.

  1. Create a SAE application with PHP 7.3 as the runtime environment.

  2. Enable Internet access.

  3. Log on to the instance by using the webshell, and run the following commands to compile and install the extension:

    # Get the source code
    wget https://pecl.php.net/get/yaml-2.2.2.tgz
    tar -zxvf yaml-2.2.2.tgz
    # Compile and install the extension
    cd yaml-2.2.2 && \
    phpize && \
    ./configure && \
    make && make install
  4. Download the extension to your on-premises machine. For more information, see Upload and download files to diagnose applications through logs.

    The directory of the extension:

    /home/admin/yaml-2.2.2/modules/yaml.so
  5. Include the extension in the ZIP package of the application. ZIP package structure:

    .
    ├── nginx
    │ ├── default.conf
    │ ├── fastcgi_params
    │ ├── global
    │ └── root.dir
    ├── php
    │ ├── index.php
    └── extensions
     └── yaml.so
  6. Deploy the application, upload the ZIP package that contains the extension, and then add the extension configuration to the php.ini file to enable the extension.

    extension=/home/admin/app/extensions/yaml.so
  7. Log on to the instance by using the webshell and check whether the extension is loaded.

    # php -m | grep yaml
    yaml

Common configurations

Default service ports

The following table describes the default service ports of NGINX and PHP-FPM configured by SAE:

Program

Port

NGINX

80

PHP-FPM

127.0.0.1:9000

PHP-FPM logs: standard output

  • PHP-FPM logs are contained in real-time logs. The following sample code provides an example of the log configuration in the /usr/local/etc/php-fpm.d/docker.conf file:

    [global]
    error_log = /proc/self/fd/2
    log_limit = 8192
    
    [www]
    access.log = /proc/self/fd/2
  • The PHP error logs that are not displayed. The following sample code provides an example of the log configuration in the php.ini file.

    error_log => no value => no value
    log_errors => Off => Off
    log_errors_max_len => 1024 => 1024
  • If you want to include the error logs in real-time logs, you must configure the php.ini file when you create or deploy an application. You must specify the following directory to store the error logs:

    log_errors = on
    error_log = /proc/self/fd/2

NGINX logs: standard output

  • NGINX logs are contained in real-time logs. The following sample code provides an example of the log configuration in the ./nginx/default.conf file:

    #access_log /dev/stdout;
    error_log stderr;
  • You can enable access_log. By default, the logs are contained in real-time logs.

File caching: static files, images, and media

You can configure the php.ini file to determine whether to enable OPcache for PHP. SAE enables OPcache by default. For more information about the configuration, see OPcache runtime configuration.

  • Enable OPcache: This option is suitable for online websites to accelerate code execution and reduce disk input/output (I/O).

  • Disable OPcache: This option is suitable for debugging scenarios. Code modifications can immediately take effect.

The following sample code provides an example of the php.ini configuration:

; Enable OPcache
opcache.enable=1
; Disable OPcache
;opcache.enable=0

File caching: PHP code

You can enable or disable caching in NGINX for many static files, such as images, videos, Cascading Style Sheets (CSS) files, and JavaScript files. For more information about the configuration, see Module ngx_http_headers_module.

  • Enable static resource caching: This option is suitable for online services and websites that load many media files. This improves traffic throughput and reduces read input/output operations per second (IOPS).

  • Disable static resource caching: This option is suitable for remote debugging, upload and download, and other usage scenarios. You can access the files in real time.

The following sample code provides an example of the ./nginx/default.conf configuration:

    # Static resource caching
    location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
        # Disable caching
        #expires off;
        # Enable caching
        expires 1s;
    }

Enhanced features

Hot restart services

  • ConfigMap allows you to modify the configurations without interrupting services.

  • Webshell allows you to restart services without interrupting services.

    • Hot restart of NGINX

      # Test the validity of the configuration file
      nginx -t
      # Restart NGINX without service interruptions
      nginx -s reload
    • Hot restart of PHP-FPM (There is a certain probability of stream interruption. You need to check the php.ini configuration.)

      ps uax | grep 'php-fpm: master' | grep -v grep | awk '{print $2}' | xargs kill -USR2

Upload and download

SAE provides multiple methods to allow you to upload and download files. You can select one of the following methods based on your business requirements:

  • Use the SAE console: You can upload and download files for debugging. The file size cannot exceed 10 MB. For more information, see Use the webshell feature to upload and download files.

  • Use the SAE console: You can perform remote debugging.

  • Use the persistence storage: Apsara File Storage NAS or Object Storage Service (OSS).

Python

Runtime environment

Update time

Operating system version

Description

Python 3.9.15

2022-10-11

Debian 11.0

Python 3.9.15

.NET Core

To facilitate development and deployment, the base images of SAE are built based on the official .NET base images and are preconfigured with common troubleshooting tools and font packages.

Version

Base image

Operating system

Runtime

3.1

mcr.microsoft.com/dotnet/aspnet:3.1

Debian GNU/Linux 10 (buster)

  • Microsoft.AspNetCore.App 3.1.32

  • Microsoft.NETCore.App 3.1.32

5.0

mcr.microsoft.com/dotnet/aspnet:5.0

Debian GNU/Linux 10 (buster)

  • Microsoft.AspNetCore.App 5.0.17

  • Microsoft.NETCore.App 5.0.17

6.0

mcr.microsoft.com/dotnet/aspnet:6.0

Debian GNU/Linux 11 (bullseye)

  • Microsoft.AspNetCore.App 6.0.33

  • Microsoft.NETCore.App 6.0.33

7.0

mcr.microsoft.com/dotnet/aspnet:7.0

Debian GNU/Linux 11 (bullseye)

  • Microsoft.AspNetCore.App 7.0.20

  • Microsoft.NETCore.App 7.0.20

8.0

mcr.microsoft.com/dotnet/aspnet:8.0

Debian GNU/Linux 12 (bookworm)

  • Microsoft.AspNetCore.App 8.0.8

  • Microsoft.NETCore.App 8.0.8