baimard/gestion

[EN] ParseError: syntax error, unexpected 'String' (T_STRING)

Closed this issue · 19 comments

Just installed Gestion on my instance and got this error.
Any idea what's causing this?

FehlerGestion.txt

Nextcloud 22.2.3
PHP 7.3.31
Mariadb 10.3.31
Linux 4.19.0-18-amd64 x86_64 (Debian 10)

Sorry for that but the gestion application is only compatible with php 7.4

Could you please update ?

:)

Ok.
Thank you.
I will try it soon.
Perhaps, there should be a hint in the app store concerning this dependency, because Nextcloud still supports PHP 7.3

Yes, I need to solved that, but I don't know if I can force a PHP dependency ...

Not a big thing for me.
I have to update PHP anyway.

Thanks for your great work and your help.

Best regards
Martin

Thank you for reporting.

I wait for your feedback before close this issue

Hello, I am experiencing the same issue. My machine
Linux debian 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
My php Version:

PHP 7.4.27 (cli) (built: Dec 20 2021 21:32:33) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

I am behind a nginx proxy manager and the error in the frontend shows:
Bildschirmfoto 2022-01-13 um 09 30 20

Dear @SmartLiving-Rocks,

You're not experiencing the same issue, I need full log of your error. Please open a new issue with full log details.

Well, ok - please double-check before I open another issue. For me, it looks similar 🤷‍♂️

{"reqId":"Z7xtLP3iym6qgB6SUaZI","level":3,"time":"2022-01-13T09:36:16+00:00","remoteAddr":"123.1.007.245","user":"anonymousXX","app":"index","method":"GET","url":"/index.php/apps/gestion/","message":"syntax error, unexpected 'String' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36","version":"23.0.0.10","exception":{"Exception":"ParseError","Message":"syntax error, unexpected 'String' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/composer/composer/ClassLoader.php","line":428,"function":"Composer\\Autoload\\includeFile","args":["/var/www/html/nextcloud/apps/gestion/lib//Db/Bdd.php"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->","args":["OCA\\Gestion\\Db\\Bdd"]},{"function":"spl_autoload_call","args":["OCA\\Gestion\\Db\\Bdd"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":112,"function":"__construct","class":"ReflectionClass","type":"->","args":["OCA\\Gestion\\Db\\Bdd"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Gestion\\Db\\Bdd"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Gestion\\Db\\Bdd"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Gestion\\Db\\Bdd"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Gestion\\Db\\Bdd",true]},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map","args":[{"__class__":"Closure"},[{"__class__":"ReflectionParameter","name":"AppName"},{"__class__":"ReflectionParameter","name":"request"},{"__class__":"ReflectionParameter","name":"UserId"},"*** sensitive parameter replaced ***",{"__class__":"ReflectionParameter","name":"rootFolder"},"And 2 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"__class__":"ReflectionClass","name":"OCA\\Gestion\\Controller\\PageController"}]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Gestion\\Controller\\PageController"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Gestion\\Controller\\PageController"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Gestion\\Controller\\PageController"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":144,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Gestion\\Controller\\PageController"]},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Gestion\\Controller\\PageController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"gestion.page.index"}]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/gestion/"]},{"file":"/var/www/html/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/nextcloud/apps/gestion/lib/Db/Bdd.php","Line":8,"CustomMessage":"--"},"id":"61dff2b44e29e"}`

it's same I confirme ...

Update or new instance ?

is it when you install it or when you do something ?

It is an updated instance.

Could you please share me your database information :

Version, SGBD and if it's possible the structure of oc_gestion_* table ? (* is a wildcard)

Server version: 10.3.31-MariaDB-0+deb10u1 Debian 10

The second answer is: I do not know how to find out 😅 but maybe the instructions I have followed some time ago have the answer included https://www.howtoforge.de/anleitung/wie-man-nextcloud-unter-debian-10-installiert/

Yes
As suggested I have updated it. php -v results in:

PHP 7.4.27 (cli) (built: Dec 20 2021 21:32:33) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

No. The Nextcloud Administration overview showed still the 7.3
So you are right! Thanks for your patience, it was my fault!

I have not had the apache told that another version should be used:

a2dismod php7.3
a2enmod php7.4

But after that, Nextcloud was not loading, so I installed the php-extensionsusing this command:

apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

After that was finished, I rebooted the server and I said "Hello" to the working GESTION 🥳
Bildschirmfoto 2022-01-13 um 13 35 25

Don't worry, I'm really happy to help the "Gestion" community :)

In fact, I use a very new functionality in php 7.4, it's why we need to update php version.

Thank you for your feedback !

Just to be more precise, you can watch the php version use by your instance in : Parameter / System / at bottom of the page