Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
Toolset Views and Layouts beta versions are not activating and gives error:
Fatal error: Arrays are not allowed in class constants in C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-content\plugins\wp-views\vendor\toolset\toolset-common\inc\autoloaded\compatibility\compatibility-loader\toolset-theme-Integration-settings-collections-factory.php on line 16
Solution:
The issue was not reproduced, We have double checked and installed latest Views beta on our localhost and it installed & Activated successfully. Potentially it had something to do with server environment or specific site issue.
1. Please delete “Views” and “Layouts” plugin from WordPress dashboard (make sure there is no “Views” and “Layouts”folder exists in your FTP, if you see any “Views” and “Layouts”folder in FTP then please delete it) and re-install Views.2.5-b1 and Layouts.2.1-b1 again.
2. Fatal error: Arrays are not allowed in class constants" occurs as this function requires the server PHP version to be atleast 5.6 or later.
This support ticket is created Il y a 7 années et 2 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am trying to: install the betas for views.2.5-b1 and layouts.2.1-b1
Plugins install, but when I activate it throws an error. Note, when I re-installed layouts.2.0.3 it went smoothly. Views.2.4.1 also went smoothly. So it seems to be in the beta plugins.
Fatal error: Arrays are not allowed in class constants in C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-content\plugins\wp-views\vendor\toolset\toolset-common\inc\autoloaded\compatibility\compatibility-loader\toolset-theme-Integration-settings-collections-factory.php on line 16
Thank you for contacting Toolset support. I am not able to reproduce this issue at my end, I have successfully installed and activated Views.2.5-b1 and Layouts.2.1-b1 at my local site.
Please delete “Views” and “Layouts” plugin from WordPress dashboard (make sure there is no “Views” and “Layouts”folder exists in your FTP, if you see any “Views” and “Layouts”folder in FTP then please delete it) and re-install Views.2.5-b1 and Layouts.2.1-b1 again.
I deleted the plugins and folders and tried to install again. I still run into the same error. In fact I deleted all plugins except Types, but when I try to install the beta for Views and Layouts I get the error.
When I re-installed the stable version of Views and Layouts, just to see if it was my localhost that was the problem, I had no error.
I have just checked and installed latest Views beta on my localhost (xampp) and it installed successfully screenshot attached.
1. I assume you are installing it from WP Dashboard >> Plugins page. Please change theme to a default theme as well while installing beta (e.g. Twenty Seventeen theme). See how it goes now?
2. Please try increasing PHP Execution time and PHP Memory for your local server (xampp, mamp, etc)
3. OR please install it manually by placing “wp-views” plugin folder (extract plugin zip file) directly into /wp-content/plugins folder.
-- After placing folder, go to WP Dashboard >> Installed Plugins >> Views beta should be there >> then activate it. It should be activated this way, if not please let me know.
-- You can also try it in a fresh WP Installation with all default settings and plugins/theme.
I tried #3.... OR please install it manually by placing “wp-views” plugin folder (extract plugin zip file) directly into /wp-content/plugins folder.
That didn't work, so I changed my php.ini file to these settings:
memory_limit = 256M
upload_max_filesize = 64M
max_execution_time = 300
max_input_time = 1000
I tried the auto uploader, then I tried to manual method.
In both cases its the same error when I Activate, not when I install. It installs fine, but Activation fails:
Fatal error: Arrays are not allowed in class constants in C:\Users\Owner\Documents\Websites\views-beta.dev\wp-content\plugins\wp-views\vendor\toolset\toolset-common\inc\autoloaded\compatibility\compatibility-loader\toolset-theme-Integration-settings-collections-factory.php on line 16
Thanks for trying the steps, upon further searching I found that the " Fatal error: Arrays are not allowed in class constants" occurs as this function requires the server PHP version to be atleast 5.6 or later (your current server PHP Version is 5.5.24).
So please upgrade server's php version and it will resolve the issue hopefully. It worked for me when I tested on WP site running on PHP version 5.6.30
You can also upload your site to an online server which typically may have a more uptodate php version which will in result let the Views activate and run fine.
Thanks for those suggestions, Noman. I'll try it on a staging site, or wait until the stable versions come out. I'm still really excited about this path Toolset is taking.
I still want to point out that I have no problem uploading, installing and activating all the stable Toolset plugins. And my current localhost is meeting the rest of my WordPress development needs. Its just these two Toolset betas that are giving me problems.