Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install on PHP 8.1 #271

Open
Akiracr opened this issue Nov 1, 2022 · 11 comments
Open

Can't install on PHP 8.1 #271

Akiracr opened this issue Nov 1, 2022 · 11 comments
Labels

Comments

@Akiracr
Copy link

Akiracr commented Nov 1, 2022

Environment

  • Mibew Messenger version:
  • OS: Debian 11 (bullseye)
  • Web server: Apache 2
  • PHP: 8.1.8
  • MySQL: MariaDB-1:10.3.31

Expected behavior

Can install and use.

Actual behavior

Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/ParameterBag.php on line 220

Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/ParameterBag.php on line 230

Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/HeaderBag.php on line 288

Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/HeaderBag.php on line 298

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/ak/mibew/vendor/symfony/http-foundation/Request.php on line 316

Warning: session_start(): Session cannot be started after headers have already been sent in /var/www/html/ak/mibew/libs/init.php on line 67

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/ak/mibew/vendor/symfony/http-foundation/Request.php on line 316

Deprecated: Return type of Symfony\Component\Routing\RouteCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php on line 56

Deprecated: Return type of Symfony\Component\Routing\RouteCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php on line 66

Deprecated: Symfony\Component\Config\Resource\FileResource implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/ak/mibew/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php on line 21

Deprecated: Symfony\Component\Routing\Route implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/ak/mibew/vendor/symfony/routing/Symfony/Component/Routing/Route.php on line 22

Deprecated: Symfony\Component\Routing\CompiledRoute implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/html/ak/mibew/vendor/symfony/routing/Symfony/Component/Routing/CompiledRoute.php on line 19

Fatal error: Database was not initialized correctly in /var/www/html/ak/mibew/libs/classes/Mibew/Database.php on line 120

Steps to reproduce the behavior

Go to http://127.0.0.1/ak/mibew/install.php in a clean build

@faf faf added the pending label Nov 2, 2022
@faf
Copy link
Member

faf commented Nov 2, 2022

  1. You didn't specified the version of Mibew Messenger.
  2. How have you got Mibew to install? Has it been downloaded from our official site, or have you built it youself?

@Akiracr
Copy link
Author

Akiracr commented Nov 2, 2022

Hi @faf, sorry for the missing information.

I clone master and built it myself as result of it was mibew-3.5.7.zip, I've download a zip from the official site and compared them with my build and it is practically are equals, so i've tested that version and the result are the same deprecated messages.

Please tell me if you need more information or if there is something that i can do to help to solve the problem.

@faf
Copy link
Member

faf commented Nov 2, 2022

@Akiracr Well, ok, I'll try to reproduce the issue. What Ubuntu distro do you use? And what PHP modules are installed (you could just post the output of php -m command).

At the moment I could only guess that the last fatal error probably means that you hadn't properly set database connection options in the configuration.

@Akiracr
Copy link
Author

Akiracr commented Nov 2, 2022

I'm running it on a docker php:8.1-apache container, i've reviewed an it is Debian 11 (bullseye), the result of "php -m" is

[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

My database config settings seems to be ok, it can't connect to the database but /install redirects to /operator/login, here is the complete output when try to access to /install

Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/ParameterBag.php on line 220

Deprecated: Return type of Symfony\Component\HttpFoundation\ParameterBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/ParameterBag.php on line 230

Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/HeaderBag.php on line 288

Deprecated: Return type of Symfony\Component\HttpFoundation\HeaderBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/ak/mibew/vendor/symfony/http-foundation/HeaderBag.php on line 298

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/ak/mibew/vendor/symfony/http-foundation/Request.php on line 316

Warning: session_start(): Session cannot be started after headers have already been sent in /var/www/html/ak/mibew/libs/init.php on line 67
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mibew.plugin' doesn't exist

@faf
Copy link
Member

faf commented Nov 3, 2022

So, to sum it up, the problem occurs in Debian 11. Right?

@Akiracr
Copy link
Author

Akiracr commented Nov 3, 2022

Yes

@faf
Copy link
Member

faf commented Nov 8, 2022

Ok. I've set up the clear system with Debian 11.

To begin with your installation is definetely is not the standard Debian 11. Since Debian 11 comes with PHP 7.4. Though, it's not a big deal to set PHP 8.1 there.

Then. Your problem consists of two parts.

  1. Deprecation warnings.
  2. Fatal error.

I was able to reproduce the first part. I was able to (partly) reproduce the second part. I was unable to reproduce the whole issue in the way you've described.

Deprecation warnings comes from the Symfony framework. I have some ideas on how to get rid of them, but at the moment I'm unable to say when that will happen. Right now the most simple way is to hide that warnings by either disabling the display_errors option in mod_php config, or at least set the error_reporting to recommended production value of E_ALL & ~E_DEPRECATED & ~E_STRICT.

As of fatal error... Frankly, no idea. I'm unable to reproduce it.

  1. Double check your database connection settings in config.yml. Does your database exists? Does your database user has permissions to access and manage the database?
  2. Do you have mod_rewrite enabled and AllowOverride All option set in the configuration of Apache2?

@Akiracr
Copy link
Author

Akiracr commented Nov 9, 2022

Hi @faf, thanks for your time and comments, i has been testing and found that mibew is not compatible with PHP 8.0 and 8.1, on PHP 7.4 works without problems and warnings.

It cound be because some symfony dependencies are so old and are under unmaintain status.

I'll try to work on it.

@faf
Copy link
Member

faf commented Nov 9, 2022

i has been testing and found that mibew is not compatible with PHP 8.0 and 8.1, on PHP 7.4 works without problems and warnings.

That's not true. Mibew Messenger is compatible with PHP 8.1 since v3.4.3. For example, our demo installation works on PHP 8.1.

Warnings on deprecated features (that comes from some Symfony components as well as from some parts of Mibew itself) doesn't mean that the code is not functional. It will become not functional with future versions of PHP, but at the moment the code works.

@Akiracr
Copy link
Author

Akiracr commented Nov 9, 2022

Umm, could you test the installation on PHP 8.1 recently?

My environments of php 8.1, 8.0 and 7.4 are indical about OS, Apache, and php extensions, but in PHP 8.0 and 8.1 gets fatal error. Maybe there are some problem only with the instalation process.

@faf
Copy link
Member

faf commented Nov 9, 2022

Yes, it was tested on clean Debian 11 system (with attached deb.sury.org repo to get PHP 8.1). Both install and main functionality works fine except for deprecation warnings when standard PHP settings altered to produce most verbose output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants