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

phpMyAdmin 4.9.6 + PHP 7.0: PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in vendor/twig/twig/src/Node/Expression/GetAttrExpression.php #16397

Closed
fluff opened this issue Oct 10, 2020 · 13 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@fluff
Copy link

fluff commented Oct 10, 2020

Describe the bug

phpMyAdmin 4.9.6 running on Debian 9's PHP 7.0.33-0+deb9u10 packages white-screens and logs the following in the apache error log:

PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in ..../phpMyAdmin-4.9.6-all-languages/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php on line 21

To Reproduce

  1. Install phpMyAdmin 4.9.6 on Debian9/PHP7.0
  2. Load the front page

Expected behavior

phpMyAdmin should load up and display a login screen, and no errors logged to the apache log

Server configuration

  • Operating system: Debian 9.13
  • Web server: Apache 2.4.25-3+deb9u9
  • Database version: MariaDB 10.1.45-0+deb9u1
  • PHP version: PHP 7.0.33-0+deb9u10
  • phpMyAdmin version: 4.9.6

Client configuration

  • Browser: Chrome 86.0.4240.75
  • Operating system: macOS 10.15.7

Additional context

Reverting back to phpMyAdmin 4.9.5 works. Isn't the 4.9.x series supposed to be PHP 7.0 compatible?

@ibennetch
Copy link
Member

Thank you for the report.

Yes, this is supposed to work with PHP 7.0; there seems to have been some incompatibility introduced with one of the library dependencies we use for handling page templates...we'll take a look.

@fluff
Copy link
Author

fluff commented Oct 10, 2020

Thanks. Looks like a too modern version of twig was included.

Perhaps the composer.json file in the 4.9.x branch should contain something like this to prevent installing dependencies that have a too high minimum php version?

"config": {
  "platform": {
    "php": "7.0.33" (or "5.5.38"?)
  }
}

@williamdes
Copy link
Member

Without looking I would suggest that the PHP version building the 4.9 bundle was not using the lower supported php version.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Oct 10, 2020
@williamdes williamdes added this to Needs triage in issues via automation Oct 10, 2020
@williamdes williamdes moved this from Needs triage to High priority in issues Oct 10, 2020
@williamdes williamdes added this to the 4.9.7 milestone Oct 10, 2020
@ibennetch
Copy link
Member

I am uploading new phpMyAdmin releases 4.9.7 and 5.0.4 which should fix this.

Thank you for your report.

issues automation moved this from High priority to Closed Oct 15, 2020
@williamdes williamdes self-assigned this Oct 15, 2020
@4levels
Copy link

4levels commented Oct 27, 2020

Issue is still there on 4.9.7 release.
PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /vendor/twig/twig/src/Node/Expression/TestExpression.php on line 19
I am using the github tag RELEASE_4_9_7, could that be related? Reason being phpmyadmin is installed via nix deployment using github tags.

@4levels
Copy link

4levels commented Oct 27, 2020

I tried reverting to 4.9.6. 4.9.5 to no avail :-(

@ibennetch
Copy link
Member

@4levels Could you please confirm which PHP version you're using? I tested with PHP 5.6 before the release. It could be related to running from Git, could you please let us know a little more about your deployment process? Are you running composer update or composer install as part of the build? Can you run tell us the output of composer info | grep twig?

@4levels
Copy link

4levels commented Oct 27, 2020

Sure, glad to!

# php --version
PHP 7.0.32 (cli) (built: Sep 11 2018 06:27:06) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.32, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.7.1, Copyright (c) 2002-2019, by Derick Rethans```

@4levels
Copy link

4levels commented Oct 27, 2020

Composer calls:

composer update --no-interaction --no-progress --no-suggest --prefer-dist --no-dev
composer install --no-interaction --no-progress --no-suggest --prefer-dist --no-dev
composer dump-autoload -o

@4levels
Copy link

4levels commented Oct 27, 2020

composer info | grep twig
twig/extensions             v1.5.4  Common additional features for Twig that do not directly belong in core
twig/twig                   v2.14.0 Twig, the flexible, fast, and secure template language for PHP

@4levels
Copy link

4levels commented Oct 27, 2020

Seems a bit weird to me that different versions of twig are installed, or is this supposed to be?

@4levels
Copy link

4levels commented Oct 27, 2020

A friend pointed out that it might be related to calling composer update during the installation. I just updated my build steps to not call composer update and all is well now! Sorry for the false positive here, my bad

@ibennetch
Copy link
Member

That's strange to me (as someone who sort of understands Composer but is by no means an expert), composer update should upgrade packages to the latest version that meets the requirements and in the case of RELEASE_4_9_7 with PHP 7.0, that should be twig 1.34, not 2.14.

Seems a bit weird to me that different versions of twig are installed, or is this supposed to be?

The version numbers for the various Twig components aren't in sync or really related to each other, so this is not surprising. Good thought, though.

Anyway, I'm glad you sorted it out!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

4 participants