docker-php icon indicating copy to clipboard operation
docker-php copied to clipboard

ini_set() doesn't seem to work with php-fpm

Open shinsenter opened this issue 3 years ago • 4 comments

Issue description

As the title, ini_set() doesn't seem to work with php-fpm. I tried confirming it with the following images:

  • serversideup/php:7.3-fpm-apache
  • serversideup/php:7.4-fpm-apache
  • serversideup/php:8.0-fpm-apache
  • serversideup/php:8.1-fpm-apache

Environment

  • Opertaing System Version: macOS 12
  • Docker Version: Docker version 20.10.12, build e91ed57

Steps to reproduce the issue

  1. Create a index.php
  2. Use below code:
<?php
echo ini_get('display_errors');

if (ini_get('display_errors')) {
    ini_set('display_errors', '0');
} else {
    ini_set('display_errors', '1');
}

echo ini_get('display_errors');
  1. ini_set returns false, display_errors value unchanged.

What is expected?

Value of display_errors will change.

Additional details / screenshots

I have not changed any settings from your Docker images.

shinsenter avatar Jan 24 '22 04:01 shinsenter

Update: I was able to temporarily fix it by replacing php_admin_* settings. I added this line to my Dockerfile.

RUN grep -rl '^php_admin_' /etc/php/ | xargs -I {} sed -i 's/^php_admin_/php_/g' {}

shinsenter avatar Jan 24 '22 08:01 shinsenter

Thanks for your report! I will take a look into this soon.

jaydrogers avatar Jan 25 '22 00:01 jaydrogers

@jaydrogers

I appreciate you giving these projects away for free (and hope it stays free for future maintenance). I'm also digging into the components of your projects, to make sure they are transparent, secure and performant enough for the projects I'm working on.

shinsenter avatar Jan 26 '22 01:01 shinsenter

Thanks!! We love contributing to open source and our goal is to continue to make it free.

We just launched a sponsorship program for those interested (https://github.com/sponsors/serversideup), but no pressure on signing up. We haven't really promoted it yet.

We're hoping to gain a lot of momentum where we can and build up a solid financial base where we can release even more open source projects. Lots of things in the works! 🚀

jaydrogers avatar Jan 26 '22 01:01 jaydrogers