Jump to content

Parse Error: syntax error, unexpected '|', expecting variable (T_VARIABLE) (line 70 of


Webjack
 Share

Recommended Posts

Hello, ?

I installed PW for the first time and now it's time to experiment with the installation of modules.

The first one on my list was also my first problem ?

It's the FrontendForms module, which I installed in the Modules/install section of my administration.

A Parse Error: syntax error, unexpected occurred and persists on all items in the Modules category (site, Core, Configure etc...) and of course, I don't know how to fix this error in the site/modules/FrontendForms/FrontendForms.module file at line 70.

Maybe it's because this module is designed for PHP>=8.0.0 and my site runs on PHP Version 7.4.33?

Can you tell me if this error can still be fixed and, if not, how to uninstall this module?

Thank you for your help. ?

error-FrontendForms_module.png

Link to comment
Share on other sites

Je viens d'essayer de mettre à jour le site vers PHPVersion 8.0.30 et le message a disparu, le site s'affiche (appartement) normalement mais une nouvelle erreur apparaît dans l'administration lorsque j'essaye de visualiser mes pages. Voir l'image ci-dessus et une série d'avertissements apparaissent en mode débogage.

Je pense que je devrais rester avec PHP version 7.4.33, n'est-ce pas ?

Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'mysql.so' (essayé : /opt/alt/php80/usr/lib64/php/modules/mysql.so (/opt/alt/php80/usr/lib64/php/ modules/mysql.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type), /opt/alt/php80/usr/lib64/php/modules/mysql.so.so (/opt/alt/php80/usr/lib64 /php/modules/mysql.so.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type)) dans  Inconnu  à la ligne  0

Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'json.so' (essayé : /opt/ alt/php80/usr/lib64/php/modules/json.so (/opt/alt/php80/usr/lib64/php/modules/json.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type), /opt /alt/php80/usr/lib64/php/modules/json.so.so (/opt/alt/php80/usr/lib64/php/modules/json.so.so : impossible d'ouvrir le fichier d'objet partagé : aucun fichier de ce type ou répertoire)) dans  Inconnu  en ligne  0

Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'nd_mysqli.so' (essayé : /opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so (/opt/alt/ php80/usr/lib64/php/modules/nd_mysqli.so : symbole non défini : mysqlnd_global_stats), /opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so.so (/opt/alt/php80/usr/ lib64/php/modules/nd_mysqli.so.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type)) dans  Inconnu  à la ligne  0

Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'xml.so' (essayé : /opt /alt/php80/usr/lib64/php/modules/xml.so (/opt/alt/php80/usr/lib64/php/modules/xml.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type), / opt/alt/php80/usr/lib64/php/modules/xml.so.so (/opt/alt/php80/usr/lib64/php/modules/xml.so.so : impossible d'ouvrir le fichier d'objet partagé : aucun fichier de ce type ou répertoire)) dans  Inconnu  à la ligne  0

Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'xmlreader.so' (essayé : /opt/alt/php80/usr/lib64/php/modules/xmlreader.so (/opt/alt /php80/usr/lib64/php/modules/xmlreader.so : symbole non défini : dom_node_class_entry), /opt/alt/php80/usr/lib64/php/modules/xmlreader.so.so (/opt/alt/php80/usr /lib64/php/modules/xmlreader.so.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type)) dans  Inconnu  à la ligne  0

Attention : Le module "mcrypt" est déjà chargé dans  Inconnu  à la ligne  0

Attention : Module "intl " est déjà chargé dans  Inconnu  à la ligne  0

Attention : Le module "fileinfo" est déjà chargé dans  Inconnu  à la ligne  0

Attention: Démarrage PHP : Impossible de charger la bibliothèque dynamique 'ioncube.so' (essayé : /opt/alt/php80/usr/lib64/php/modules/ioncube.so (/opt/alt/php80/usr/lib64/php/modules /ioncube.so : impossible d'ouvrir le fichier d'objet partagé : aucun fichier ou répertoire de ce type), /opt/alt/php80/usr/lib64/php/modules/ioncube.so.so (/opt/alt/php80/usr/lib64/ php/modules/ioncube.so.so : impossible d'ouvrir le fichier objet partagé : aucun fichier ou répertoire de ce type)) dans  Inconnu  à la ligne  0

Attention : Le module "mysqli" est déjà chargé dans  Inconnu  à la ligne  0

Attention : Impossible de charger le module "memcached" car le module requis "igbinary" n'est pas chargé dans  Inconnu  à la ligne  0

 

php-8-pages.png

Link to comment
Share on other sites

Salut @Webjack,

On va le faire en anglais si ça te dérange pas, ce sera compréhensible par tout le monde. ?

3 hours ago, Webjack said:

site/modules/FrontendForms/FrontendForms.module file at line 70

Yes this is a PHP version issue, it's about union type "string | int" introduced in PHP 8.

2 hours ago, Webjack said:
Attention : Démarrage PHP : Impossible de charger la bibliothèque dynamique 'mysql.so'

You have issues in your system installation, none of MySQL or other PHP extensions are found. These requirements are validated at the begin of PW installation.

ProcessWire works fine with PHP 8+.

  • Thanks 1
Link to comment
Share on other sites

8 hours ago, da² said:

We'll do it in English if you don't mind, so everyone can understand. ?

Oops ! A copy/paste error. I'm sorry. :-//

HI da² ?

For your information, this PW was installed in PHP version 7.4.33 and then upgraded to PHP 8.0.30 to check whether the parse error persisted.

There were no errors during installation, which only appeared after the upgrade, and this probably explains it.

I've upgraded to 7.4.33 and there are no more warnings except for the module's parse errors.

In fact, I'm pleased with this little problem, because it's made me realize that installing a module can be a hassle, and that you have to be careful to read their documentation, which brings me to another question.

If, in a case like this, activating a module prevents PW from working properly and you can't uninstall it, what's the best way to get rid of it?

Delete its files via FTP, for example?

In the meantime, I'm going to install ProcessWire in another directory, this time in PHP 8.0.30, and install this module to see what happens.

To be continued... ?

 

Quote

ProcessWire fonctionne correctement avec PHP 8+.

Ok for that. Thank you. ?

Link to comment
Share on other sites

5 hours ago, Webjack said:

Delete its files via FTP, for example?

Yes at least you'll get rid of errors if they prevent PW to work. There's also a database table "modules" that references installed modules I suppose, I don't know if it's preferable to remove module entry or not.

  • Thanks 1
Link to comment
Share on other sites

OK to delete the files and the Modules table in the DB. ?

Well, I reinstalled in PHP8 on an independent space and everything went fine. ?

I was able to install my first modules and discover how they work, plus a lot of other things ?

Of course, all this raises a lot of new questions, but I'll ask them when the time comes.

Many thanks da² for your help in helping me discover ProcessWire. ?

 

  • Like 1
Link to comment
Share on other sites

Bonjour,?

Je voudrais revenir sur les erreurs survenues lors de la mise à niveau de PW vers PHP8.

J'ai été gêné par cette histoire et j'ai procédé à une autre installation propre en PHP8 cette fois avec le profil intermédiaire   car je progresse dans mes études.

Surprise, juste avant l'installation, PW m'a donné les mêmes  erreurs listées ci-dessous.

J'ai donc vérifié les paramètres de mon PHP8 et finalement contacté mon support hébergeur (O2switch en France) qui m'a dit que les paramètres sont OK.

J'ai installé et malgré les erreurs renvoyées grâce  au débogage activé et finalement tout semble fonctionner malgré ces erreurs à condition que certains dysfonctionnements n'apparaissent pas à l'utilisation.

Cette nouvelle installation se trouve dans  https://php8.reseauk.info/  et info.PHP là https://php8.reseauk.info/infophp.php  et les erreurs restent visibles jusqu'à ce que  je découvre pourquoi elles apparaissent.

Powered by ProcessWire CMS   /   Admin Login


Warning: PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /opt/alt/php80/usr/lib64/php/modules/mysql.so (/opt/alt/php80/usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory), /opt/alt/php80/usr/lib64/php/modules/mysql.so.so (/opt/alt/php80/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'json.so' (tried: /opt/alt/php80/usr/lib64/php/modules/json.so (/opt/alt/php80/usr/lib64/php/modules/json.so: cannot open shared object file: No such file or directory), /opt/alt/php80/usr/lib64/php/modules/json.so.so (/opt/alt/php80/usr/lib64/php/modules/json.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'nd_mysqli.so' (tried: /opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so (/opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so: undefined symbol: mysqlnd_global_stats), /opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so.so (/opt/alt/php80/usr/lib64/php/modules/nd_mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'xml.so' (tried: /opt/alt/php80/usr/lib64/php/modules/xml.so (/opt/alt/php80/usr/lib64/php/modules/xml.so: cannot open shared object file: No such file or directory), /opt/alt/php80/usr/lib64/php/modules/xml.so.so (/opt/alt/php80/usr/lib64/php/modules/xml.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'xmlreader.so' (tried: /opt/alt/php80/usr/lib64/php/modules/xmlreader.so (/opt/alt/php80/usr/lib64/php/modules/xmlreader.so: undefined symbol: dom_node_class_entry), /opt/alt/php80/usr/lib64/php/modules/xmlreader.so.so (/opt/alt/php80/usr/lib64/php/modules/xmlreader.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: Module "mcrypt" is already loaded in Unknown on line 0

Warning: Module "intl" is already loaded in Unknown on line 0

Warning: Module "fileinfo" is already loaded in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'ioncube.so' (tried: /opt/alt/php80/usr/lib64/php/modules/ioncube.so (/opt/alt/php80/usr/lib64/php/modules/ioncube.so: cannot open shared object file: No such file or directory), /opt/alt/php80/usr/lib64/php/modules/ioncube.so.so (/opt/alt/php80/usr/lib64/php/modules/ioncube.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: Module "mysqli" is already loaded in Unknown on line 0

Warning: Cannot load module "memcached" because required module "igbinary" is not loaded in Unknown on line 0

 

Edited by Webjack
Mistake
Link to comment
Share on other sites

 
Quote

What is your Linux distribution and how do you install PHP8?

 

Oops! I don't know but I can find it. My Provider is O2switch in France.

I'm on a shared server that I can't control.

My hosting is in PHP 7.4 but I can change it specifically in a directory with an instruction in the .haccess.

I have changed this directory to PHP8.

ProcessWire needs ioncube?

Link to comment
Share on other sites

 

Informations sur le serveur

Informations sur le serveur

Élément Détails
Package d’hébergement o2
Nom du serveur framboise
Version de cPanel 110.0 (build 17)
Version Apache 2.4.58
Version de MySQL 10.6.16-MariaDB
Architecture x86_64
Système d’exploitation linux
Adresse IP partagée 109.234.161.17
Chemin vers Sendmail /usr/sbin/sendmail
Chemin vers Perl /usr/bin/perl
Version de Perl 5.16.3
Version du noyau 4.18.0-425.19.2.lve.el7h.x86_64
Link to comment
Share on other sites

I have no idea how they configure PHP, you probably already know this page: https://faq.o2switch.fr/hebergement-mutualise/tutoriels-cpanel/selecteur-version-php

You may also try to install missing PHP modules corresponding to your errors (see video). Usually on Debian I only need to add this modules "php-mysql php-gd php-zip php-mbstring" but on another Linux distribution you have more or less to install.

  • Thanks 1
Link to comment
Share on other sites

image.thumb.png.c74e5c31d83959ff9859211d2b6a0f5a.pngphp3.thumb.png.1be30a2863e68233c797a0da321427e3.pngphp-1.thumb.png.43cd2522432e5753d0fba318bf64568d.pngphp-4.thumb.png.a220a4c9f35d7b4060acda3b508d468d.pngphp-5.thumb.png.ce0ec595591280df3c040b4128eecce3.pngphp8-1.thumb.png.c7d1500e0abcfdc880c8dcc4afaa42f4.pngphp8-2.thumb.png.07faf2c0225bc3ef6a374b37bf0ec2b8.pngphp8-3.thumb.png.061a32d0dd7bdb4afb16be14ce4dec0c.pngphp8-4.thumb.png.e781400e3b7973aab61c89ed842396f7.pngphp-5.thumb.png.ce0ec595591280df3c040b4128eecce3.pngphp8-options-1.thumb.png.035579ac1d7488f9491eb4dd710a097a.pngphp8-options-2.thumb.png.c7d41eec36daebd0c5680a9340356d5d.pngphp8-options-3.thumb.png.7acc2a0fda8a8ac0e5d450f3f675cd5c.pngphp8-php.ini-2.thumb.png.753f79a340f0fb77b5b38089b44dbd57.pngphp-8-5.thumb.png.5b525c823608d448275aa55e35f00df7.pngphp-8-php.ini-1.thumb.png.69ae905c543dfecb47f8919b26b231c5.pngHello da², :)

The PHP8 options on my server were indeed es next things to look at. Here they are.

I'd already ticked a few boxes but couldn't go any further for lack of knowledge.
There are extensions, options and the contents of the php.ini file at the root of the directory (in subdomain) php8.reseauk.info/

I don't want to upgrade all the hosting to PHP8 because I've been with this host for a long time and I have a lot of sites and programs that are a bit old and I'm afraid that some of them won't support the upgrade to PHP8 and it would be difficult for me to upgrade them.

But this morning I thought of something.

I could upgrade the host to PHP+ and set the directories of the most important sites I care about to PHP7.4.

What version would you recommend: PHP8.0, PHP8.1, PHP8.2 or PHP8.3? 

Of course, ProcessWire has to be comfortable with it.
image.thumb.png.c74e5c31d83959ff9859211d2b6a0f5a.png

php-2.png

php-selecteur.png

php8-5.png

Link to comment
Share on other sites

9 minutes ago, Webjack said:

What version would you recommend: PHP8.0, PHP8.1, PHP8.2 or PHP8.3?

It's up to you, I know PW supports at least up to PHP 8.2. But if you don't use any new PHP feature you can stay with PHP 7.4.

11 minutes ago, Webjack said:

I'd already ticked a few boxes but couldn't go any further for lack of knowledge.

You only need to tick the ones linked with your error messages.

Link to comment
Share on other sites

Quote

I'd already ticked a few boxes but couldn't go any further for lack of knowledge.

It is not so simple, I have actually already checked two or three boxes according to the error messages but some were already checked like MSQL for example and wondered (as I have for some time now) about nd_mysqli.so and other json.so.so because I don't know what it is other than I find .so extensions in the php.ini file.

It's like "Warning: The "mcrypt" module is already loaded in Unknown at line 0" although I found this box unchecked (I checked it).

Quote

It's up to you, I know PW supports at least up to PHP 8.2. But if you don't use any new PHP feature you can stay with PHP 7.4.

Some of the modules are coded for PHP8.

Link to comment
Share on other sites

29 minutes ago, Webjack said:

It's like "Warning: The "mcrypt" module is already loaded in Unknown at line 0"

It's probably a bad server/PHP configuration, maybe this will help: https://stackoverflow.com/a/36455035
Or ask your provider, I have no idea what they do with PHP.

That's why I only own dedicated Debian servers in VPS, it's the same price and you are 100 % free to manage system configuration yourself, without the need of using graphical tools that you don't really know what they do. It requires knowledge in Debian and Linux administration but with Google everything can be learned.

  • Thanks 1
Link to comment
Share on other sites

Quote

This requires knowledge of Debian and Linux administration but with Google everything can be learned.

Yes quite.

When I was younger, I started to be interested in server management because my dream at that time was to set up a system for automatic creation and hosting of websites not for commercial purposes. but for my personal needs concerning my associative activities.

I started very well but it took up all my time and forced me to improve my technical skills and you can't do everything at the same time. I had to choose not to educate myself.

For our errors, I wonder if the system I use to activate PHP8 in a directory of a hosting of a different version via .htaccess has something to do with it.

It's the host who explains how to do it in his faq's but he specifies that this is not ideal.

Personally I only use it to test scripts that need a specific PHP version and it has always worked like that.

For my host, it is one of the best in France and I have been with them for more than 10 years as I am satisfied with the quality-price relationship and the feedback from the always attentive and highly competent support.

Although the one I spoke with the other night told me that the configuration was correct, but I think he was thinking of something else at that time. It is true that it was Christmas Eve. ,)
Well, I'm going to switch the hosting to PHP8 + to see what happens even if it means starting the installation again. I don't like to fail.

See you for the news. ?

Link to comment
Share on other sites

I was right this time. Well, in principle. Now we have to test. ?
I switched my hosting to PHP8.2. The alerts disappeared but I still reinstalled ProcessWire although reinstalling is a big word since I overwrote the files from the old installation with new ones but forgot to dump the database so that it was all installed.

I had tried to install modules there which all had errors and I will know this evening if everything is ok now.

On the other hand, in PHP8+, I have at least two of my sales techniques that no longer work and I will have to notify them. ?

Link to comment
Share on other sites

  • 2 weeks later...

Hello everyone, 

Good news since the other day, :)

I've taken PHP more seriously and am starting to put the documentation into practice, or at least what I understand of it.

I can say that my next site will be powered by ProcessWire, as I'm so comfortable with this tool, which promises many long, studious and rewarding hours (months, years) for a little tinkerer.

I've left my past behind and entered another dimension.

Thanks again to all of you. :)

My signature site is now dedicated to this apprenticeship.

All I have to do now is learn how to make it multilingual, but that will come ;)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...