TrafeX / docker-php-nginx

Docker image with PHP-FPM 8.3 & Nginx 1.26 on Alpine Linux
https://hub.docker.com/r/trafex/php-nginx
MIT License
1.37k stars 736 forks source link

`max_execution_time` not getting applied in php.ini #123

Closed foremtehan closed 1 year ago

foremtehan commented 1 year ago

This is my php.ini file:

[PHP]
max_execution_time = 59

[Date]
date.timezone="UTC"
expose_php= Off

Dockerfile:

COPY docker-config/php.ini /etc/php81/conf.d/custom.ini

Inside the container:

image

But looks like it did not applied :

image

I also removed the keyword [PHP] but didn't work either

TrafeX commented 1 year ago

Hi @foremtehan,

I believe this is because artisan overrides the max_execution_time to set it to unlimited for CLI commands.

foremtehan commented 1 year ago

I don't think so, Here is the artisan file https://github.com/laravel/laravel/blob/9.x/artisan

TrafeX commented 1 year ago

You're right, I forgot that PHP overrides a few settings when using the CLI; https://www.php.net/manual/en/features.commandline.differences.php As the docs said, these settings cannot be changed via ini files, you can only override it in the code with init_set.