一、PHP 版本选择
云函数 SCF 目前支持的 PHP 开发语言包括如下版本:
·PHP 8.0
·PHP 7.4
·PHP 7.2
·PHP 5.6
你可以在函数创建时,选择你所期望使用的运行环境,PHP 8.0、PHP 7.4、PHP 7.2 或 PHP 5.6。
二、相关环境变量
目前 PHP 8.0、PHP 7.4 运行环境中内置的 PHP 相关环境变量见下表:
| 环境变量 Key | 具体值或值来源 |
| PHP_INI_SCAN_DIR | /opt/php_extension:/var/user/php_extension |
目前 PHP 7.2、PHP 5.6 运行环境中内置的 PHP 相关环境变量见下表:
| 环境变量 Key | 具体值或值来源 |
| PHP_INI_SCAN_DIR | /var/user/php_extension:/opt/php_extension |
更多详细环境变量说明请参见 环境变量说明。
三、内置的扩展列表
如下列出目前已安装的 PHP 扩展:
| PHP 版本 | 扩展列表 |
| PHP 8.0 | Core, runkit7, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, json, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, exif, tokenizer, xml, xmlreader, xmlwriter, runtime, swoole |
| PHP 7.4 | Core, runkit7, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, json, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, exif, tokenizer, xml, xmlreader, xmlwriter, swoole |
| PHP 7.2 | Core, runkit7, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, json, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlwriter, zip, eio, memcached, imagick, mongodb, protobuf, redis, swoole, Zend OPcache |
| PHP 5.6 | Core, runkit, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, json, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlwriter, zip, eio, memcached, imagick, mongodb, swoole, protobuf, redis, Zend OPcache |