Resolving deprecation warnings
Sometimes you see a lot of the following warnings in your Flarum installation:
NOTICE: PHP message: PHP Deprecated:
This is happening because your webserver is not configured properly for production use.
There are two solutions:
Server side
Your server should be configured for production use, this is not the case. PHP can be configured in the php.ini
to ignore deprecation (and other) warnings by setting the value like so:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
This is the recommendation for production environments. You will probably have to edit the php.ini for the webserver (apache/nginx) and for cli as well to fully make the deprecation warnings go away.
Flarum side
Edit your extend.php
and add the following before the return [
:
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
In both cases it is possible that the changes aren't impacting your website immediately. Sometimes you will need to restart your webserver. How to do that depends on the webserver used (apache versus nginx).