Open Dret42 opened 1 month ago
Please retrieve the error message from the log file(s) https://docs.flarum.org/troubleshoot
Here the Log file:
POST http://localhost/flarum/api/fof/upload
Deprecated: Optional parameter $upload declared before required parameter $contents is implicitly treated as a required parameter in C:\XAMPP\htdocs\flarum\vendor\fof\upload\src\Adapters\Flysystem.php on line 51
Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in C:\XAMPP\htdocs\flarum\vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php:20
Stack trace:
thrown in C:\XAMPP\htdocs\flarum\vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php on line 20
I guess the definition of that method is technically not proper PHP, but I don't even know if we can fix it without breaking backward compatibility :thinking:
The default parameter is not part of the contract interface though, so it won't break any compatibility in regard to class inheritance.
While we figure this out, you should be able to get rid of this error by just disabling deprecation warnings on your site, as PHP recommends doing in production. The easiest is to change display_errors
to Off
in your php.ini
, this will also hide any PHP general warnings which you don't need in production and happen with other Flarum extensions as well.
I tried your workaround (display_errors = Off in php.ini) but the problem still persist. :( I'll wait for a better solution if possible.
Thanks anyway! :)
Make sure you edited the correct php.ini
(both the CLI and webserver [Apache/nginx/fpm] if possible, but mostly the one for the webserver). If you made the change to PHP configuration, the error message will be gone or different. Also try restarting PHP, Apache, nginx or the server (depending on what your host allows you to do) after editing the configuration
Edit: I forgot this was about XAMPP. It's been a while since I used it, I don't remember if they use multiple php.ini
files or just a global one. But if the error message is still the same, the change was definitely not registered
XAMPP has only a single php.ini file. I restarted the Apache service after every trial but has no effect: error persits!
:(
Bug Report
Current Behavior When I try to upload an image I get an error and the image is not inserted inline BUT it is loaded into my image folder. Likewise, if I try to delete them from my media folder I receive an error but then the image is deleted (after refresh the page).
Steps to Reproduce
Expected Behavior The image are correctly inserted and deleted without error messages.
Environment
XAMPP
Flarum 1.8.5 PHP 8.2.4 MySQL 10.4.28-MariaDB Driver Code: sync Driver Sessione: file
Browser
Chrome and Firefox