Have found a few other threads asking about how to install a custom version of PHP, but no replies… maybe this can be the lucky one.
PHP 8 is due out very soon and so we are all gonna need to test our WP sites/plugins/etc. Is there a way to install PHP 8 so that Local will run with it?
PHP 8 was a tricky thing to get to compile on all the OSes, and Xdebug wasn’t something that we heavily QA’d.
We wanted to get something in the hands of others to play with, so if you are tinkering and find something, can you post it here?
I haven’t had time to try it out yet, but I’ve carved out some time this sprint to take a closer look at Xdebug in general and will spend a bit of time testing on PHP 8 – anything I find, I’ll let you know!
I don’t think the xdebug.remote_port is used in xDebug 3.0 but it seems to be needed for switching the value from PHP 7.4.x or PHP 7.3.x where these values are set.
Also xdebug.start_with_request=trigger is more appropriate as running the step debugger even when it is not activated in the IDE will generate warnings.
In summary, what seems to work consistently is if I change the php.ini.hbs file inside of ~/Library/Application Support/Local Beta/lightning-services/php-8.0.0+1/conf/php.ini.hbs to contain the following.
Looks like a great opportunity to test the lightning services updater
If you want the debugger always active as you have with xdebug.start_with_request=yes you should add xdebug.log_level=0 to eliminate the errors that show in the log as if the debugger in the IDE isn’t running.
This is awesome feedback, thanks for diving in an working with it!
Right now we don’t have a way of copying or merging in settings within the php.ini.hbs between different php services so common settings will need to be added manually between the different files.
thanks @afragen
I got an timeout error on xdebug in my debug.log and it was solved by copying the above code in php/php.ini.hbs. The problem seems to have been that the client_port was set to 9000 instead of 9003. After changing that, I haven’t had the error again.
php 7.4.1 had :9000 too, but had no problem with it.
PHP 8 has brought a lot of changes and WP core has done some amazing work getting things wired up, but the larger WordPress ecosystem should only be considered “Beta Compatible” with PHP 8.
Resharing this link from earlier in the thread, but if you’re wanting a more in-depth look at PHP 8 through the WordPress+Local lens, here’s a help doc to get you oriented:
The one main annoyance as @afragen has pointed out is the difference between Xdebug versions. I’ve created a story for the Local team to focus on getting things current, but no eta on when that will be done.
I’ll mark this feature requests as solved since it’s been released to stable, so be on the lookout for the improvements to come related to upgrading the PHP lightning service to Xdebug 3.0.