0

我正在尝试在 stackery 层的基础上为 AWS Lambda 创建一个 php 7.3.6 层。[见这里]

我尝试通过将添加和添加到模块文件夹并进入 php.ini 来使mysqli.somySQLpdo_mysql.so可用mysqlnd.so

该层本身可以正常工作,但不会加载 mySQL 扩展。如果我创建一个仅由它组成的简单 lambda 函数,phpinfo()会告诉我,我的 ini 文件没有找到,它应该在/etc.

phpinfo() 的输出:

System  Linux 169.254.201.229 4.14.114-93.126.amzn2.x86_64 #1 SMP Wed May     8 20:42:46 UTC 2019 x86_64
Build Date  May 28 2019 15:55:44
Server API  Built-in HTTP server
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc
Loaded Configuration File   (none)
Scan this dir for additional .ini files     /opt/etc/php-7.3.d/:/var/task/php-7.3.d/
Additional .ini files parsed    (none)
PHP API     20180731
PHP Extension   20180731
Zend Extension  320180731
Zend Extension Build    API320180731,NTS
PHP Extension Build     API20180731,NTS
Debug Build     no
Thread Safety   disabled
Zend Signal Handling    enabled
Zend Memory Manager     enabled
Zend Multibyte Support  disabled
IPv6 Support    enabled
DTrace Support  available, disabled
Registered PHP Streams  https, ftps, compress.zlib, php, file, glob, data, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters   zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
[...]

我用于 php 层的 .zip 文件的文件夹结构如下:

bootstrap
php.ini
bin
| php
lib 
| [...]
| php
| 7.3
| | modules
| | | [...]

我是否必须更改我的文件夹结构,或者我可以告诉 php 在哪里搜索php.ini

4

0 回答 0