Troubleshooting Common Page Builder by SiteOrigin PHP Errors
Content
Users of the Page Builder by SiteOrigin plugin sometimes encounter PHP errors that can disrupt their website's functionality or admin area. These errors are often related to specific server configurations, plugin conflicts, or outdated software. This guide outlines the most common PHP errors and provides steps to resolve them.
1. Fatal Error: Can't use function return value in write context
Error Message Example: Fatal error: Can't use function return value in write context in .../siteorigin-panels/inc/styles.php on line 67
Why it happens: This error occurs on servers running very old, unsupported versions of PHP (below 5.6). The plugin code uses a syntax that is not compatible with these outdated PHP versions.
Solution: The most effective and recommended solution is to update your server's PHP version. WordPress itself recommends using PHP 7.4 or higher. Contact your web hosting provider for assistance upgrading your PHP version. This not only resolves the error but also significantly improves your site's security and performance.
2. Error: Cannot use string offset as an array
Error Message Example: Uncaught Error: Cannot use string offset as an array in .../siteorigin-panels/siteorigin-panels.php:568
Why it happens: This is typically caused by corrupted or invalid page layout data that the plugin attempts to process.
Solution: A recent plugin update may have introduced a fix for the underlying data issue. Ensure your Page Builder by SiteOrigin plugin is updated to the latest version. If the error persists after updating, you may need to identify and repair the specific page or post with the corrupted layout data.
3. TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given
Error Message Example: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in .../admin-widget-dialog.php:204
Why it happens: This error suggests a code incompatibility, often arising after a plugin update. A function is expecting an array but is receiving a string instead.
Solution: This type of error is usually patched quickly by the development team. Check for and install any available updates for the Page Builder by SiteOrigin plugin. If no update is available, temporarily switching to a default WordPress theme (like Twenty Twenty-One) can help determine if your theme is causing a conflict.
4. PHP Warnings and Notices (Undefined index)
Error Message Example: PHP Notice: Undefined index: cell_index in .../renderer-legacy.php on line 136 or Notice: Undefined index: background_image_attachment_fallback in .../styles-admin.php on line 389
Why it happens: These are not fatal errors but rather warnings and notices that appear when WP_DEBUG is enabled. They occur when the code tries to access an array key that does not exist.
Solution: For a live website, these warnings should be hidden from visitors. You can disable debug mode by setting WP_DEBUG to false in your wp-config.php file. These notices are often addressed in subsequent plugin updates, so keeping the plugin updated is the long-term solution.
5. Admin AJAX 500 Errors or Blank White Screens
Symptoms: Unable to save posts/pages, a blank white screen appears in the admin, or a 500 Internal Server Error occurs when trying to edit content.
Why it happens: This can have many causes, including a server-level firewall (ModSecurity) blocking a request, a memory limit exhausted, or a fatal PHP error that is not being displayed.
Solution:
- Enable Debugging: Enable
WP_DEBUGin yourwp-config.phpfile to reveal any hidden fatal errors that are causing the white screen. - Check for Conflicts: Deactivate all other plugins and switch to a default theme. If the problem is resolved, reactivate them one-by-one to identify the conflicting software.
- Check Server Error Logs: Contact your hosting provider to check the server's error logs for any specific ModSecurity or PHP errors that may not be visible in WordPress.
- Increase Memory Limit: Try increasing the PHP memory limit by adding
define('WP_MEMORY_LIMIT', '256M');to yourwp-config.phpfile.
General Best Practices
- Keep Everything Updated: Always keep WordPress, your theme, and all plugins, including Page Builder by SiteOrigin, updated to their latest versions to benefit from bug fixes and security patches.
- Use a Supported PHP Version: Run your site on a actively supported PHP version (7.4 or higher). This is the single most effective way to prevent many common errors.
- Test in a Staging Environment: Before applying updates or changing PHP versions on your live site, test them on a staging or development copy of your website to avoid unexpected downtime.
If you continue to experience issues after trying these steps, detailed error messages from your debug log are the most helpful information for further troubleshooting.
Related Support Threads Support
-
Attempt Block Recovery – SiteOrigin Layout Blockhttps://wordpress.org/support/topic/attempt-block-recovery-siteorigin-layout-block/
-
New plugin update causes fatal errorhttps://wordpress.org/support/topic/new-plugin-update-causes-fatal-error/
-
Since 2.6.5 new error with background_image_attachment_fallbackhttps://wordpress.org/support/topic/since-2-6-5-new-error-with-background_image_attachment_fallback/
-
Update failedhttps://wordpress.org/support/topic/update-failed-61/
-
Update 2.29.12 Fatale errorhttps://wordpress.org/support/topic/update-2-29-12-fatale-error/
-
Warning: Undefined array key “sync”https://wordpress.org/support/topic/warning-undefined-array-key-sync/
-
PHP 8 Errorhttps://wordpress.org/support/topic/php-8-error-15/
-
URGENT: conflict between Site Origin child theme and WordPress 4.9.8https://wordpress.org/support/topic/urgent-conflict-between-site-origin-child-theme-and-wordpress-4-9-8/
-
error iframehttps://wordpress.org/support/topic/error-iframe/
-
Last update errorhttps://wordpress.org/support/topic/last-update-error-8/
-
Uncaught ReferenceError: panelsOptions is not definedhttps://wordpress.org/support/topic/uncaught-referenceerror-panelsoptions-is-not-defined/
-
PHP version compatiblehttps://wordpress.org/support/topic/php-version-compatible/
-
Error upgrading to version 2.11.8https://wordpress.org/support/topic/error-upgrading-to-version-2-11-8/
-
Uncaught Error: Class ‘SiteOrigin_Panels_Widgets_PostContent’ not foundhttps://wordpress.org/support/topic/uncaught-error-class-siteorigin_panels_widgets_postcontent-not-found/
-
500 error on page with page builderhttps://wordpress.org/support/topic/500-error-on-page-with-page-builder/
-
Latest version – 2.16.12 Crashes Sitehttps://wordpress.org/support/topic/latest-version-2-16-12-crashes-site/
-
cannot reach my site nor login to WPhttps://wordpress.org/support/topic/cannot-reach-my-site-nor-login-to-wp-2/
-
load_textdomain_just_in_time errorshttps://wordpress.org/support/topic/load_textdomain_just_in_time-errors/
-
Conflict with Admin Columns pluginhttps://wordpress.org/support/topic/conflict-with-admin-columns-plugin-3/
-
Will Plugin Run when I update PHP?https://wordpress.org/support/topic/will-plugin-run-when-i-update-php/
-
White page when using revision managment in post sectionhttps://wordpress.org/support/topic/white-page-when-using-revision-managment-in-post-section/
-
RSS Feed Issuehttps://wordpress.org/support/topic/rss-feed-issue-23/
-
Fatal errorhttps://wordpress.org/support/topic/fatal-error-3323/
-
Fatal Parse Errorhttps://wordpress.org/support/topic/fatal-parse-error-3/
-
406 Not Acceptablehttps://wordpress.org/support/topic/406-not-acceptable-21/
-
Various errorshttps://wordpress.org/support/topic/various-errors-8/
-
Fatal error: Can’t use function return value in Site Originhttps://wordpress.org/support/topic/fatal-error-cant-use-function-return-value-in-site-origin/
-
Error establishing a database connectionhttps://wordpress.org/support/topic/error-establishing-a-database-connection-1034/
-
shows http 500 error when yith polygon theme is activated.https://wordpress.org/support/topic/shows-http-500-error-when-yith-polygon-theme-is-activated/
-
Argument #2 ($haystack) must be of type array, string givenhttps://wordpress.org/support/topic/argument-2-haystack-must-be-of-type-array-string-given/
-
Undefined index: background_image_attachment_fallbackhttps://wordpress.org/support/topic/undefined-index-background_image_attachment_fallback/
-
technical issuehttps://wordpress.org/support/topic/technical-issue-10/
-
Unknown error. Failed to load the form. Please check your internet connection, chttps://wordpress.org/support/topic/unknown-error-failed-to-load-the-form-please-check-your-internet-connection-c/
-
My wordPress site is not workinghttps://wordpress.org/support/topic/my-wordpress-site-is-not-working-3/
-
Incompatible with PHP 7.3https://wordpress.org/support/topic/incompatible-with-php-7-3-2/
-
Cannot use string offset as an arrayhttps://wordpress.org/support/topic/cannot-use-string-offset-as-an-array-3/
-
SiteOrigin – unexpected T_FUNCTIONhttps://wordpress.org/support/topic/unexpected-t_function-10/
-
2.12.0 PHP Fatal error 500 on WP < 5.x.xhttps://wordpress.org/support/topic/2-12-0-php-fatal-error-500-on-wp-5-x-x/
-
Parse error: syntax error after your updatehttps://wordpress.org/support/topic/parse-error-syntax-error-after-your-update/
-
Fatar errorhttps://wordpress.org/support/topic/fatar-error-2/
-
Siteorigin plugin stopped workinghttps://wordpress.org/support/topic/siteorigin-plugin-stopped-working/
-
Fatal error on premium builderhttps://wordpress.org/support/topic/fatal-error-on-premium-builder/
-
PHP Fatal errorhttps://wordpress.org/support/topic/php-fatal-error-151/
-
Crash with WordPress 5.7https://wordpress.org/support/topic/crash-with-wordpress-5-7/
-
Fatal Error for PHP Version 7.3https://wordpress.org/support/topic/fatal-error-for-php-version-7-3/
-
Getting Error all of a suddenhttps://wordpress.org/support/topic/getting-error-all-of-a-sudden/
-
403 Forbiddenhttps://wordpress.org/support/topic/403-forbidden-137/
-
Issues with plugin prebuilt templates and your forum thinks I am spamhttps://wordpress.org/support/topic/issues-with-plugin-prebuilt-templates-and-your-forum-thinks-i-am-spam/
-
New Page Errorhttps://wordpress.org/support/topic/new-page-error-4/
-
PHP 8.0 / 8.1 versionhttps://wordpress.org/support/topic/php-8-0-8-1-version/
-
PHP Noticeshttps://wordpress.org/support/topic/php-notices-151/
-
Undefined index: option_namehttps://wordpress.org/support/topic/undefined-index-option_name/
-
Error php componentshttps://wordpress.org/support/topic/error-php-components/
-
Receiving fatal error – is it just me?https://wordpress.org/support/topic/receiving-fatal-error-is-it-just-me/
-
Admin-ajax error 400https://wordpress.org/support/topic/admin-ajax-error-400-3/