studio icon indicating copy to clipboard operation
studio copied to clipboard

Broken site causes PHP errors when Studio starts

Open jeroenpf opened this issue 1 year ago • 0 comments

Quick summary

I have tested with a site where the feedburner-form plugin was installed. The plugin only works on PHP versions lower than 8 as it uses the 'create_function` function which has been removed in PHP >8.

I configured the site to run on PHP 7.4 and I can use the site just fine. However, when starting Studio, I still see errors related to create_function in the output.

Here is an example:

PHPExecutionFailureError2: PHP.run() failed with exit code 255 and the following output: PHP Fatal error:  Uncaught Error: Call to undefined function create_function() in /var/www/html/wp-content/plugins/feedburner-form/control/widgets.php:214
Stack trace:
#0 /var/www/html/wp-content/plugins/feedburner-form/feedburner-form.php(45): require()
#1 /var/www/html/wp-settings.php(522): include_once('/var/www/html/w...')
#2 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1375): require('/var/www/html/w...')
#3 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1294): WP_CLI\Runner->load_wordpress()
#4 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#5 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#6 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#7 phar:///tmp/wp-cli.phar/php/boot-phar.php(20): include('phar:///tmp/wp-...')
#8 /tmp/wp-cli.phar(4): include('phar:///tmp/wp-...')
#9 /tmp/run-cli.php(37): require('/tmp/wp-cli.pha...')
#10 {main}
  thrown in /var/www/html/wp-content/plugins/feedburner-form/control/widgets.php on line 214

Steps to reproduce

  1. Start Studio with npm start
  2. Have a PHP 7.4 site with a broken plugin like the feedburner-form or add custom code that tries to use the create_function function.
  3. Observe that the site works fine.
  4. Now start Studio again and you should see the errors pop up in the terminal.

What you expected to happen

There should not be any errors while Studio is starting.

What actually happened

I got a bunch of errors in the terminal indicating that something is broken.

Impact

One

Available workarounds?

No but the app is still usable

Platform

No response

Logs or notes

No response

jeroenpf avatar Aug 16 '24 10:08 jeroenpf