Sarjuuk / aowow

Database viewer for TrinityCore based on aowow by @LordJZ, based on the JS-Engine of Wowhead
204 stars 217 forks source link

Cannot install aowow on debian 11: PHP Parse error: syntax error, unexpected '(' in /var/www/html/aowow/includes/utilities.php on line 1779 #347

Closed 33mirra33 closed 2 years ago

33mirra33 commented 2 years ago

Hello,

you have done perfect job with this aowow project remake to php7.4/8.0. Thank you for this project and for your work.

I am clueless at point 6 of your readme how to install it. When I run php aowow --setup I get this error: PHP Parse error: syntax error, unexpected '(' in /var/www/html/aowow/includes/utilities.php on line 1779

Here is my php version:

# php --version
PHP 7.4.29 (cli) (built: Apr 22 2022 06:45:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies

And here is part of utilities.php, including line 1779 (that one with // coment):


 /********************/
    /* Field Operations */
    /********************/

    public static function newList(int $type, ?array $conditions = []) : ?BaseType
    {
        if (!self::exists($type))
            return null;

        return new (self::$data[$type][self::IDX_LIST_OBJ])($conditions); // this is line 1779 of utilities.php
    }

Modules enabled in my php 7.4: (I double checked all requirements in readme and it seems like I have all required modules enabled)

php -m

[PHP Modules] bz2 calendar Core ctype curl date dom exif FFI fileinfo filter ftp gd gettext gmp hash iconv json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib

[Zend Modules] Zend OPcache

System:

I have literally no idea how could I fix the error, so I decided to submit new issue in order to help the project. Thank you

33mirra33 commented 2 years ago

Just info, that v1.1. works. So I can confirm there shouldn't be issue in my apache, linux or PHP settings.

Sarjuuk commented 2 years ago

It's probably similar to #342. Can you upgrade to php v8.0 or higher and try again?

Yes i know, the README says v7.4 is fine. It's sadly outdated.

33mirra33 commented 2 years ago

It works on PHP 8.1? I LOVE YOU SO MUCH!!! :) I am going to try it immediately. Thank you, I will tell you if it works when I switch my debian to php 8.1.

33mirra33 commented 2 years ago

Confirmed. On PHP 8.1 v.1.2. (22th march 2022 commit) works PERFECTLY. :) Thank you so much! 👍

php -v
PHP 8.1.6 (cli) (built: May 17 2022 16:48:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies
# php aowow --setup
00:43:54          FileGen::init() - creating required directories
00:43:54          created 8 extra paths
00:43:54          Please enter your database credentials.
Press any key to continue:
00:44:11          select a numerical index to use the corresponding entry
00:44:11          [0] aowow                  <empty>
00:44:11          [1] world                  <empty>
00:44:11          [2] auth                   <empty>
00:44:11          [3] add an additional Character DB

I was able to run v.1.1 on php 7.4.26. (info for anyone in the future to see this issue)