File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ function start_webserver() {
17
17
case 0 :
18
18
// exec the command
19
19
$ HANDLER = getenv ('_HANDLER ' );
20
- chdir ('/var/task ' );
21
- exec ("PHP_INI_SCAN_DIR=/opt/etc/php-7.1.d/:/var/task/php-7.1.d/ php -S localhost:8000 -c /var/task/php.ini -d extension_dir=/opt/lib/php/7.1/modules ' $ HANDLER ' " );
20
+ $ handler_components = explode ('/ ' , $ HANDLER );
21
+ $ handler_filename = array_pop ($ handler_components );
22
+ $ handler_path = implode ('/ ' , array_merge (['/var/task ' ], $ handler_components ));
23
+ chdir ($ handler_path );
24
+ exec ("PHP_INI_SCAN_DIR=/opt/etc/php-7.1.d/:/var/task/php-7.1.d/ php -S localhost:8000 -c /var/task/php.ini -d extension_dir=/opt/lib/php/7.1/modules ' $ handler_filename' " );
22
25
exit ;
23
26
24
27
// return the child pid to parent
You can’t perform that action at this time.
0 commit comments