Core: Flarum Beta 10, 11 Not Support in PHP 7.4.1

Created on 30 Jan 2020  路  6Comments  路  Source: flarum/core

Follow Official Installation Tutorial

https://flarum.org/docs/install.html

Bug Report

Current Behavior
Flarum beta 10, 11 (or all...?) not support in PHP 7.4.1

Steps to Reproduce

  1. Using PHP 7.4.1.
  2. composer create-project flarum/flarum . --stability=beta
    or
    composer create-project flarum/flarum:v0.1.0-beta.10 . --stability=beta
  3. Set all about site setting (httpd-vhosts.conf, httpd.conf).
  4. Open the browser, and get the ERROR:
Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\ft\vendor\illuminate\support\ServiceProvider.php on line 84
...

Full error like this:
image

Expected Behavior
If using PHP 7.3.6, the installer is work.
image

Environment

  • Flarum version: v0.1.0-beta.10, v0.1.0-beta.11
  • Website URL: localhost
  • Webserver: Apache
  • Hosting environment: localhost
  • PHP version: 7.3.6, 7.4.1
  • Browser: Google Chrome 79.0.3945.130
Output of "php flarum info", run this in terminal in your Flarum directory.

C:\xampp\htdocs\ft>php --version
PHP 7.4.1 (cli) (built: Dec 17 2019 19:24:02) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

C:\xampp\htdocs\ft>php flarum info
PHP Notice:  Trying to access array offset on value of type null in C:\xampp\htdocs\ft\vendor\illuminate\support\ServiceProvider.php on line 84

Notice: Trying to access array offset on value of type null in C:\xampp\htdocs\ft\vendor\illuminate\support\ServiceProvider.php on line 84


  Command "info" is not defined.  

typcleanup

Most helpful comment

Okay, I hope this PR fixes all problems. :smiley:

All 6 comments

Nice catch, thanks for the report!!!

Can you try out this change and see whether that works? (You will find the appropriate files in the vendor/flarum/core directory.

It works, but...
Only for the installer page... xDDD

Here is error from Flarum installing:
image

Hell of "Trying to access array offset on value of type null"

It's seems like PHP 7.4 change and deprecation.


Test Environment

  • Flarum version: beta.10
  • PHP version: 7.4.1


Update

I tried refresh the page, and it is work so far.
I'm not sure if there are any hidden issues, but at least I have tried many of the core functions of the forums, and they are all normal.

image

Thanks for your help!!!
We will have to switch to another LESS library, it seems, but right now that's harder than I thought.

In the meantime - as a hack - can you add this line after the opening PHP tag of public/index.php?

~php
error_reporting(E_ALL ^ E_NOTICE);
~

Thank you!
I tried to reinstall beta.10 with PHP 7.4.1 and just change this and this, then the installation worked perfectly, without any extra errors throwing.

Looking forward to future updates :D

I've sent a pull request to the Wikimedia less.php fork to add back support for PHP 7.1. Let's hope they accept this. :smile:

Okay, I hope this PR fixes all problems. :smiley:

Was this page helpful?
0 / 5 - 0 ratings