You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 8, 2021. It is now read-only.
I am getting this error: "Use of undefined constant XML_PI_NODE - assumed 'XML_PI_NODE' (this will throw an Error in a future version of PHP)"
This seems to indicate that the xml extension is not loaded, but I have added it to php.ini
I ran into a surprisingly similar issue just yesterday.
My mysql extension was not loaded.
I guess the php.ini file is in the wrong directory. In the resulting lambda-layer it will be found under /opt/php.ini but the bootstrap will search for it somewhere else.
Hi there. So i bumped into the same issue also, trying to install a PHP layer on my dumb AWS lambda function(I needed the json and mbstring modules). In my case, the above solution didn't work, as I was getting a permission denied error:
and add the php.ini file, that includes all the modules I need, at the top level of my lambda function folder, next to all the other files. As the lambda env runs at /var/task , setting the path at /var/task/php.ini worked for me.
The extensions are not loaded for me either, and don't know how to approach this problem.
I am getting the following error in the logs.
[Mon Sep 9 16:11:29 2019] PHP Warning: PHP Startup: Unable to load dynamic library 'xml.so' (tried: /opt/lib/php/7.3/modules/xml.so (/opt/lib/php/7.3/modules/xml.so: cannot open shared object file: No such file or directory), /opt/lib/php/7.3/modules/xml.so.so (/opt/lib/php/7.3/modules/xml.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
According to the docs, the modules should be there, but apparently they are not.
Activity
JDJunge commentedon Jun 13, 2019
I ran into a surprisingly similar issue just yesterday.
My mysql extension was not loaded.
I guess the php.ini file is in the wrong directory. In the resulting lambda-layer it will be found under /opt/php.ini but the bootstrap will search for it somewhere else.
I changed
exec("PHP_INI_SCAN_DIR=/opt/etc/php-7.${phpMinorVersion}.d/:/var/task/php-7.${phpMinorVersion}.d/ php -S localhost:8000 -c /var/task/php.ini -d extension_dir=/opt/lib/php/7.${phpMinorVersion}/modules'$handler_filename'");To
exec("PHP_INI_SCAN_DIR=/opt/ php -S localhost:8000 -c /opt/php.ini -d extension_dir=/opt/lib/php/7.${phpMinorVersion}/modules '$handler_filename'");Now extensions are beeing loaded (confimed via
phpinfo())security-intel commentedon Jul 30, 2019
Hi there. So i bumped into the same issue also, trying to install a PHP layer on my dumb AWS lambda function(I needed the json and mbstring modules). In my case, the above solution didn't work, as I was getting a permission denied error:
The solution was to update the exec line to:
exec("PHP_INI_SCAN_DIR=/opt/etc/php-7.${phpMinorVersion}.d/:/var/task/php-7.${phpMinorVersion}.d/ php -S localhost:8000 -c /var/task/php.ini -d extension_dir=/opt/lib/php/7.${phpMinorVersion}/modules '$handler_filename'");and add the php.ini file, that includes all the modules I need, at the top level of my lambda function folder, next to all the other files. As the lambda env runs at /var/task , setting the path at /var/task/php.ini worked for me.
Extensions are loaded now.
Hope this helps. All the best
zilahir commentedon Sep 9, 2019
The extensions are not loaded for me either, and don't know how to approach this problem.
I am getting the following error in the logs.
According to the docs, the modules should be there, but apparently they are not.
Any ideas, suggestions? Thanks in advance!