Phpmyadmin php parse error syntax error unexpected in

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

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

Comments

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

Expected behavior

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

Читайте также:  Java строка перевод строки

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

Additional context

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

The text was updated successfully, but these errors were encountered:

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?

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

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

Thank you for your report.

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.

I tried reverting to 4.9.6. 4.9.5 to no avail 🙁

@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 ?

# 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``` 
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 
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 

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

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

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!

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

Parse error unexpected ‘static’ Symfony ContainerBuilder.php #17503

Parse error unexpected ‘static’ Symfony ContainerBuilder.php #17503

Comments

When accessing /phpmyadmin I got this error :

Parse error: syntax error, unexpected ‘static’ (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 272

I upgraded from Ubuntu 21.10 to 22.04.
I’m running PHP 7.4 and not 8.1.
I’m running apache2 and mysql.
phpmyadmin version is 4:5.1.1+dfsg1-5ubuntu1.
The bug seems to be that Symfony dependency is for PHP 8+

How can I fix that still using php7.4 ?
Thank you

The text was updated successfully, but these errors were encountered:

I have the same issue after updated popOS.
PHP Parse error: syntax error, unexpected ‘static’ (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 272

public function addResource(ResourceInterface $resource): static < if (!$this->trackResources) < return $this; > if ($resource instanceof GlobResource && $this->inVendors($resource->getPrefix())) < return $this; > $this->resources[(string) $resource] = $resource; return $this; >

Output in my case but I think @Lukas-drz has similar:

Package: php-symfony-dependency-injection Version: 5.4.4+dfsg-1ubuntu8 Priority: optional Section: universe/php Source: symfony Origin: Ubuntu Maintainer: Ubuntu Developers Original-Maintainer: Debian PHP PEAR Maintainers Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 923 kB Provides: php-psr-container-implementation, php-symfony-service-implementation Depends: php-common, php-psr-container, php-symfony-deprecation-contracts, php-symfony-polyfill-php80 (>= 1.16), php-symfony-polyfill-php80 (= 1.22), php-symfony-polyfill-php81 ( 

I found similar issue here: https://stackoverflow.com/questions/72061079/why-does-phpmyadmin-suddenly-not-load
but I didn't find info what owner of this topic updated 🙁

Источник

Ошибка запуска PhpMyAdmin в OpenServer

Подобные ошибки при запуске phpmyadmin в OpenServer можно наблюдать:

phpmyadmin в OpenServer

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in C:\OpenServer\modules\system\html\openserver\phpmyadmin\index.php on line 8
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Overloading of string functions using mbstring.func_overload is not supported by phpseclib.' in С:\modules\system\html\openserver\phpmyadmin\vendor\phpseclib\phpseclib\phpseclib\bootstrap.php:11 Stack trace: #0 С:\modules\system\html\openserver\phpmyadmin\vendor\composer\autoload_real.php(66): require() #1 С:\modules\system\html\openserver\phpmyadmin\vendor\composer\autoload_real.php(56): 'С:\modules\syst. ') #2 С:\modules\system\html\openserver\phpmyadmin\vendor\autoload.php(7): ComposerAutoloaderInit::getLoader() #3 С:\modules\system\html\openserver\phpmyadmin\libraries\common.inc.php(85): require_once('С:\modules\syst. ') #4 С:\modules\system\html\openserver\phpmyadmin\index.php(20): require_once('С:\modules\syst. ') #5 thrown in С:\modules\system\html\openserver\phpmyadmin\vendor\phpseclib\phpseclib\phpseclib\bootstrap.php on line 11

Подобное возникает при неверной версии PHP. phpmyadmin поддерживает версию php только выше 5.5. Чтобы исправить, перейдите в настройки

phpmyadmin ошибка phpmyadmin\index.php on line 8

И выберите версию 5.5 или выше. В Разделе http сервера выберите из списка подходящую версию Apache или Nginx. После сохранения, если http сервер и php модуль соответствую, OpenServer перезагрузится. Готово.

OpenServer ошибка bootstrap.php on line 11

Источник

Оцените статью