Fatal error: Only variables can be passed by reference in..
-
Hello, woocommerce does not work with PHP 8. I have tested on several sites, and also with different providers. I always get the error message: I would be grateful for your help.
Fatal error: Only variables can be passed by reference in /wp-content/plugins/woocommerce/includes/class-wc-download-handler.php on line 532
-
I have deactivated all plugins and changed to the default theme without success.
Tested in freshly installed WordPress. Woocommerce cannot be activated at all when PHP 8 is active.Hi @arberkastrioti,
woocommerce does not work with PHP 8
Well, that’s an interesting statement. I’ve seen many users running WooCommerce on PHP 8 without issues. As a first step, please provide us the following:
- System Status: You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.
Thanks!
Hello, unfortunately I cannot activate Woocommerce with php 8. I still get the same error message: “Only variables can be passed by reference in /wp-content/plugins/woocommerce/includes/class-wc-download-handler.php on line 532”
With php 7.4 works. It seems that many people have the same problem.Hi @arberkastrioti,
Thanks for getting back.
As requested by @rainfallnixfig, if possible, could you kindly share with us your System Status report so that we can have a better context of your setup?
Thanks.
### WordPress Environment ### WordPress address (URL): https://astro-via.com Site address (URL): https://astro-via.com WC Version: 5.6.0 REST API Version: ? 5.6.0 WC Blocks Version: ? 5.5.1 Action Scheduler Version: ? 3.2.1 WC Admin Version: ? 2.5.1 Log Directory Writable: ? WP Version: 5.8 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.16 PHP Post Max Size: 512 MB PHP Time Limit: 300 PHP Max Input Vars: 10000 cURL Version: 7.52.1 OpenSSL/1.0.2u SUHOSIN Installed: – MySQL Version: 8.0.18 Max Upload Size: 512 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 5.6.0 WC Database Prefix: gowp_ Total Database Size: 85.86MB Database Data Size: 77.12MB Database Index Size: 8.74MB gowp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_woocommerce_downloadable_product_permissions: Data: 0.22MB + Index: 0.34MB + Engine InnoDB gowp_woocommerce_order_items: Data: 0.11MB + Index: 0.05MB + Engine InnoDB gowp_woocommerce_order_itemmeta: Data: 1.52MB + Index: 0.61MB + Engine InnoDB gowp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gowp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gowp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gowp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_actionscheduler_actions: Data: 0.11MB + Index: 0.13MB + Engine InnoDB gowp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_actionscheduler_logs: Data: 0.08MB + Index: 0.03MB + Engine InnoDB gowp_aiowps_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_aiowps_failed_logins: Data: 0.06MB + Index: 0.00MB + Engine InnoDB gowp_aiowps_global_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_aiowps_login_activity: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_aiowps_login_lockdown: Data: 0.05MB + Index: 0.00MB + Engine InnoDB gowp_aiowps_permanent_block: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_commentmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM gowp_comments: Data: 0.10MB + Index: 0.05MB + Engine MyISAM gowp_e_submissions: Data: 0.02MB + Index: 0.27MB + Engine InnoDB gowp_e_submissions_actions_log: Data: 0.02MB + Index: 0.11MB + Engine InnoDB gowp_e_submissions_values: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_icl_content_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_core_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_languages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_icl_languages_translations: Data: 0.19MB + Index: 0.09MB + Engine InnoDB gowp_icl_locale_map: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_message_status: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_icl_mo_files_domains: Data: 0.05MB + Index: 0.02MB + Engine InnoDB gowp_icl_node: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_reminders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_string_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_string_packages: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_string_pages: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_icl_string_positions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_string_status: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_string_translations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_icl_string_urls: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_strings: Data: 0.13MB + Index: 0.09MB + Engine InnoDB gowp_icl_translate: Data: 0.16MB + Index: 0.02MB + Engine InnoDB gowp_icl_translate_job: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_icl_translation_batches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_translation_downloads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_icl_translation_status: Data: 0.06MB + Index: 0.02MB + Engine InnoDB gowp_icl_translations: Data: 0.19MB + Index: 0.39MB + Engine InnoDB gowp_jet_post_types: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_jet_taxonomies: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM gowp_mailpoet_custom_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_dynamic_segment_filters: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_feature_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_forms: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_mailpoet_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_mailpoet_mapping_to_external_entities: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_newsletter_links: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gowp_mailpoet_newsletter_option: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_newsletter_option_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_newsletter_posts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_newsletter_segment: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_newsletter_templates: Data: 24.52MB + Index: 0.00MB + Engine InnoDB gowp_mailpoet_newsletters: Data: 0.39MB + Index: 0.03MB + Engine InnoDB gowp_mailpoet_scheduled_task_subscribers: Data: 2.52MB + Index: 0.47MB + Engine InnoDB gowp_mailpoet_scheduled_tasks: Data: 0.06MB + Index: 0.03MB + Engine InnoDB gowp_mailpoet_segments: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_mailpoet_sending_queues: Data: 1.50MB + Index: 0.03MB + Engine InnoDB gowp_mailpoet_settings: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_statistics_clicks: Data: 0.05MB + Index: 0.05MB + Engine InnoDB gowp_mailpoet_statistics_forms: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_statistics_newsletters: Data: 0.08MB + Index: 0.09MB + Engine InnoDB gowp_mailpoet_statistics_opens: Data: 0.06MB + Index: 0.08MB + Engine InnoDB gowp_mailpoet_statistics_unsubscribes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gowp_mailpoet_statistics_woocommerce_purchases: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gowp_mailpoet_stats_notifications: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_mailpoet_subscriber_custom_field: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_subscriber_ips: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_subscriber_segment: Data: 0.08MB + Index: 0.06MB + Engine InnoDB gowp_mailpoet_subscribers: Data: 0.13MB + Index: 0.22MB + Engine InnoDB gowp_mailpoet_user_agents: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_mailpoet_user_flags: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_options: Data: 8.63MB + Index: 0.16MB + Engine MyISAM gowp_postmeta: Data: 21.03MB + Index: 1.19MB + Engine MyISAM gowp_posts: Data: 6.50MB + Index: 0.11MB + Engine MyISAM gowp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_term_relationships: Data: 0.11MB + Index: 0.21MB + Engine MyISAM gowp_term_taxonomy: Data: 0.43MB + Index: 0.21MB + Engine MyISAM gowp_termmeta: Data: 0.03MB + Index: 0.02MB + Engine MyISAM gowp_terms: Data: 0.24MB + Index: 0.38MB + Engine MyISAM gowp_tg_item_elements: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_tg_item_skins: Data: 1.52MB + Index: 0.03MB + Engine InnoDB gowp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_usermeta: Data: 0.49MB + Index: 0.12MB + Engine MyISAM gowp_users: Data: 0.01MB + Index: 0.02MB + Engine MyISAM gowp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB gowp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_wc_customer_lookup: Data: 0.06MB + Index: 0.03MB + Engine InnoDB gowp_wc_download_log: Data: 0.20MB + Index: 0.20MB + Engine InnoDB gowp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_wc_order_product_lookup: Data: 0.13MB + Index: 0.16MB + Engine InnoDB gowp_wc_order_stats: Data: 0.08MB + Index: 0.05MB + Engine InnoDB gowp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB gowp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_woocommerce_gzd_dhl_im_product_services: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_dhl_im_products: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_dhl_labelmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_dhl_labels: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_packaging: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_woocommerce_gzd_packagingmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_shipment_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_shipment_items: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gowp_woocommerce_gzd_shipment_labelmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_shipment_labels: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_shipmentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_woocommerce_gzd_shipments: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gowp_woocommerce_gzd_shipping_provider: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_woocommerce_gzd_shipping_providermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gowp_wpsmtp_logs: Data: 1.52MB + Index: 0.00MB + Engine InnoDB gowp_yoast_indexable: Data: 1.52MB + Index: 0.34MB + Engine InnoDB gowp_yoast_indexable_hierarchy: Data: 0.08MB + Index: 0.14MB + Engine InnoDB gowp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gowp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gowp_yoast_prominent_words: Data: 0.17MB + Index: 0.17MB + Engine InnoDB gowp_yoast_seo_links: Data: 0.08MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### attachment: 304 class: 3 custom_css: 3 et_body_layout: 1 et_footer_layout: 2 et_header_layout: 1 et_pb_layout: 21 et_template: 2 et_theme_builder: 1 event: 35 event-recurring: 4 location: 10 mailpoet_page: 1 nav_menu_item: 10 oembed_cache: 37 page: 27 polylang_mo: 2 post: 77 product: 42 rcb-blocker: 4 rcb-cookie: 7 revision: 2 shop_order: 521 the_grid: 4 tribe_events: 1 wpforms: 3 wpupg_grid: 1 wysijap: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (18) ### WPML Multilingual CMS: by OnTheGoSystems – 4.4.12 WPML SEO: by OnTheGoSystems – 2.0.1 All In One WP Security: by Tips and Tricks HQ Peter Petreski Ruhul Ivy – 4.4.9 Beautiful and responsive cookie consent - premium add-on: by Beautiful Cookie Banner – 1.2.2 Beautiful and responsive cookie consent: by Beautiful Cookie Banner – 2.6.7 Code Snippets: by Code Snippets Pro – 2.14.1 ELEX WooCommerce Product Price Custom Text (Before & After Text) and Discount: by ELEXtensions – 1.1.3 MailPoet 3 (New): by MailPoet – 3.67.1 Really Simple SSL: by Really Simple Plugins – 5.0.10 Germanized for WooCommerce: by vendidero – 3.5.4 WooCommerce Multilingual: by OnTheGoSystems – 4.11.7 WooCommerce: by Automattic – 5.6.0 Yoast SEO Premium: by Team Yoast – 17.0 Yoast SEO: by Team Yoast – 17.0 WP SMTP: by Yehuda Hassine – 1.2.3 WPForms Lite: by WPForms – 1.6.9 WPML String Translation: by OnTheGoSystems – 3.1.10 WPML Translation Management: by OnTheGoSystems – 2.10.8 ### Inactive Plugins (0) ### ### Must Use Plugins (1) ### ET Support Center :: Must-Use Plugins Autoloader: by Elegant Themes – ### Settings ### API Enabled: ? Force SSL: – Currency: EUR (€) Currency Position: right_space Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple-en) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #11245 - /videos/ Cart: #11246 - /warenkorb/ Checkout: #11247 - /kasse/ My account: #11248 - /mein-konto/ Terms and conditions: #11346 - /agb/ ### Theme ### Name: Divi Version: 4.10.5 Author URL: https://www.elegantthemes.com Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: – ### Action Scheduler ### Complete: 183 Oldest: 2021-08-27 10:53:45 +0200 Newest: 2021-08-31 11:15:31 +0200 Pending: 8 Oldest: 2021-08-31 18:29:30 +0200 Newest: 2021-09-06 17:05:29 +0200 ### Status report information ### Generated at: 2021-08-31 11:15:40 +02:00
Thanks for sharing this with us. It seems like this is the System Status when PHP 7.4 is enabled (when it works fine)
You mentioned that the issue is happening on a fresh install of WordPress. Could you please confirm if you are testing with the Twenty Twenty One/StoreFront Theme with all plugins disabled except WooCommerce?
If the issue persists, could you please try going to Tools > Site Health and verify if there are any issues (Critical or Recommended) being identified on the Status Page, as shown here: https://d.pr/i/RDuglk
On certain server environments, changing the PHP version could change which PHP extensions are enabled. It’s important that all of these PHP extensions are still enabled even when changing to a different PHP version: https://make.www.ads-software.com/hosting/handbook/server-environment/#php-extensions
Your Web Host will be able to confirm if those extensions are enabled or not when on PHP 8.
Let me know how it goes ??
Thank you for the detailed answer. Yes with php 7.4 works without problems. I have installed a fresh wordpress and it works with PHP8. Unfortunately two existing stores with different providers that are active for a longer time do not work when I activate php 8. I will contact the provider.
Thanks again for the time.Any update on this one?
Hi @100lba,
Kindly note that this thread was resolved by the thread starter. Please check again the thread you’re following up on.
Thanks.
Yes – I have seen that.
The post was also rather directly addressed to @arberkastrioti . Wanted to know if he could solve it with the provider. And if yes, what their feedback was. Might be easier for me to target the same topic with my own provide as I have had no success doing a fresh install. And it would also help others who might have the same problem with their provider.
Thanks for the clarification.
Hopefully, @arberkastrioti will be able to get back to you.
Found the issue.
Just had to wait for 15 minutes for server restart. I didn’t know that. My bad. Runs perfectly fine on my end now.
Thanks for the update @100lba ??
I’m glad to hear that the issue is sorted. Please feel free to create a new post if you encounter a problem like this again.
Same problem here, made a test site with XAMPP on PHP 8.0 (worked) and cloned my site to a 7.4 environment. Now I get the same error:
Fatal error: Only variables can be passed by reference in [...]/wp-content/plugins/woocommerce/includes/class-wc-download-handler.php on line 533
Deavtivated the plugin per FTP and tried to reinstall it with a downloaded 5.9.0 Woocommerce version, but that doesn’t help. Can’t activate it again, because I get the warning about the fatal error.
This thread has been marked resolved by the starter. Kindly open a new thread
- The topic ‘Fatal error: Only variables can be passed by reference in..’ is closed to new replies.