friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
44 stars 18 forks source link

Reduce PHP error_reporting scope in container #238

Closed MrPetovan closed 5 months ago

MrPetovan commented 8 months ago

Is it possible to alter the container PHP configuration to suppress Deprecated and Notice messages as well as disable the error display in the script output?

scifijunk commented 7 months ago

Well, this would be nice to know since I just rebuilt my node in my k3s due to a MariaDB issue that unintentionally created myself. The "No TLS Detected" issue was easy to work around by the means of using my phone's mobile data but the PHP Warnings and such are enough to drive some people nuts. This goes twice over when one uses the friendica:stable Image. Either way, it works so I'm happy.

Sarahlizzy commented 6 months ago

Funny this should be here.

If you execute the following command in the container, it accomplishes this, as I found out yesterday:

ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

Not sure why this or something like it isn't done by default.

scifijunk commented 6 months ago

I did the "ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini" command but the errors still happen. I wonder if it has something to do with the "Vier" Theme as that is the only time I see any PHP errors when clicking on Home or Network. Currently, I'm using the "frio" Theme and it's not too bad so I decided to stick with it.

Sarahlizzy commented 6 months ago

Did you restart the container?

scifijunk commented 6 months ago

Yes, I did.

nupplaphil commented 5 months ago

The question is if it is really a good idea to suppress warnings/errors by default.

It wouldn't be hard to link the production-ready php.ini per default, but are we sure we really do want it? I'm not sure. Maybe we can add it to the README how to treat errors

Sarahlizzy commented 5 months ago

It’s a good question, and I don’t think there is a simple answer.

MrPetovan commented 5 months ago

Notices and Deprecated messages aren't useful to debug most issues, and the display in the script output isn't ideal either as it breaks pages for the most innocuous reasons.