Skip Navigation

[Resolved] views beta not activating

This thread is resolved. Here is a description of the problem and solution.

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.

Here are some threads where same fatal error has been addressed:
https://github.com/peterjaap/TogglMoneybirdIntegration/issues/9
https://stackoverflow.com/questions/1290318/php-constants-containing-arrays
https://stackoverflow.com/questions/38900385/php5-6-are-arrays-allowed-in-class-constants

This support ticket is created 7 years, 2 months ago. 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.

Our next available supporter will start replying to tickets in about 1.21 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by markH-16 7 years, 2 months ago.

Assisted by: Noman.

Author
Posts
#569837

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

Call Stack
# Time Memory Function Location
1 0.0067 305432 {main}( ) ..\plugins.php:0
2 0.0078 349152 require_once( 'C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-admin\admin.php' ) ..\plugins.php:10
3 0.0081 362008 require_once( 'C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-load.php' ) ..\admin.php:31
4 0.0083 369440 require_once( 'C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-config.php' ) ..\wp-load.php:37
5 0.0091 466592 require_once( 'C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-settings.php' ) ..\wp-config.php:90
6 0.4189 30265592 do_action( ) ..\wp-settings.php:432
7 0.4189 30266016 WP_Hook->do_action( ) ..\plugin.php:453
8 0.4189 30266064 WP_Hook->apply_filters( ) ..\class-wp-hook.php:323
9 0.4568 31363624 call_user_func_array:{C:\Users\Owner\Documents\Websites\ss-sept-207.dev\wp-includes\class-wp-hook.php:298} ( ) ..\class-wp-hook.php:298
10 0.4568 31363888 Types_Main->after_setup_theme( ) ..\class-wp-hook.php:298
11 0.4568 31363928 Toolset_Common_Bootstrap::get_instance( ) ..\main.php:123
12 0.4568 31364416 Toolset_Common_Bootstrap->__construct( ) ..\bootstrap.php:115
13 0.4726 32285456 Toolset_Common_Bootstrap->register_inc( ) ..\bootstrap.php:84
14 0.5022 33300296 Toolset_Compatibility_Loader::get_instance( ) ..\bootstrap.php:341
15 0.5032 33303968 Toolset_Compatibility_Loader->__construct( ) ..\toolset.compatibility.loader.class.php:14
16 0.5032 33304656 Toolset_Compatibility_Loader->run_theme_handler_factory( ) ..\toolset.compatibility.loader.class.php:33
17 0.5044 33318832 Toolset_Compatibility_Theme_Handler_Factory->__construct( ) ..\toolset.compatibility.loader.class.php:83
18 0.5065 33327912 Toolset_Compatibility_Theme_Handler_Factory->load_class( ) ..\toolset.layouts-themes-factory.class.php:18
19 0.5091 33372032 spl_autoload_call ( ) ..\toolset.layouts-themes-factory.class.php:60
20 0.5091 33372096 Toolset_Common_Autoloader->autoload( ) ..\toolset.layouts-themes-factory.class.php:0

#569904

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Mark,

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.

Don’t worry all of your Toolset data will be kept as it is: https://toolset.com/account/downloads/

Thank you

#570316

Hi Norman

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.

#570323

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Views 2.5-b1.png

Hello Mark,

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.

Thank you

#570341

Hi Noman

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

#570401

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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).

Here are some threads where same fatal error has been addressed:
hidden link
https://stackoverflow.com/questions/1290318/php-constants-containing-arrays
https://stackoverflow.com/questions/38900385/php5-6-are-arrays-allowed-in-class-constants

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.

Thank you

#570414

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.