studio icon indicating copy to clipboard operation
studio copied to clipboard

Feature Request: Allow selecting the PHP version

Open mrfoxtalbot opened this issue 1 year ago • 3 comments

What

Add an option to select what PHP version to use.

Why

Being able to select a PHP version is essential for development and troubleshooting.

How

We could add this as an option under "Settings":

Screenshot 2024-04-25 at 14 34 42

mrfoxtalbot avatar Apr 25 '24 12:04 mrfoxtalbot

I was looking for this exact feature, then I find out it doesn't exist yet. Let's hope we could get it done eventually.

lajennylove avatar May 09 '24 15:05 lajennylove

I have PHP 8.3.x installed on my mac. The studio thinks I'm running 8.0 and the plugin I'm developing requires at least 8.1. I've tried putting a php.ini file in wp-admin folder but no joy. How can I direct the Studio version of Wordpress to use the version installed on my machine?

listeningGlass avatar May 13 '24 01:05 listeningGlass

How can I direct the Studio version of Wordpress to use the version installed on my machine?

Currently, there is no way to direct Studio to use the PHP version installed on the machine. We may add the ability to select the version that should be used for each site at some point, though.

wojtekn avatar May 13 '24 07:05 wojtekn

I look forward to have this functionality, and as the matter of fact I could even try to contribute to its development but I couldn't find any reference to this feature or how this php server works inside the project to try implement it on my end and if I make it work, create a fork to send you a PR with that.

Anyway, thank you so much.

lajennylove avatar May 29 '24 16:05 lajennylove

Nice! Thank you :-)

On May 29, 2024 at 12:51 PM, <Jenny Martinez @.***)> wrote:

I look forward to have this functionality, and as the matter of fact I could even try to contribute to its development but I couldn't find any reference to this feature or how this php server works inside the project to try implement it on my end and if I make it work, create a fork to send you a PR with that.

Anyway, thank you so much.

— Reply to this email directly, view it on GitHub (https://github.com/Automattic/studio/issues/32#issuecomment-2137860116), or unsubscribe (https://github.com/notifications/unsubscribe-auth/BDAY5IU2N5NYW3IQTVOE6HTZEYBRBAVCNFSM6AAAAABGYZK76GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZXHA3DAMJRGY). You are receiving this because you commented.Message ID: @.***>

listeningGlass avatar May 29 '24 17:05 listeningGlass

Well, after the announcement of this platform to work locally, and using it I have had very good feelings, but I just found myself with this limitation and I have to say that while it is not active, I will continue working with other more mature options that do have it implemented . I hope it is resolved soon so we can continue testing this promising local development option.

josecarlosestirado avatar Jun 07 '24 07:06 josecarlosestirado

I started working on this with https://github.com/Automattic/studio/pull/225

We should change the default PHP version too. PHP 8.1 or PHP 8.2?

danielbachhuber avatar Jun 09 '24 21:06 danielbachhuber

Hey @danielbachhuber in my opinion I would rather to have the 8.2 that’s going to give us a bigger gap to test and work with the newer plugins and themes versions and possibly some window between having this fixed version while a version switch is being implemented.

Thanks a lot.

PS. Is there a way to know how is PHP implemented in this project? Or at least point us to the source files that are being used to implement it? It’s for a homework… Hahaha just kidding I’d love to collaborate in near future. 🥰

lajennylove avatar Jun 09 '24 21:06 lajennylove

@lajennylove Makes sense, thanks for the input

PS. Is there a way to know how is PHP implemented in this project? Or at least point us to the source files that are being used to implement it? It’s for a homework… Hahaha just kidding I’d love to collaborate in near future.

It's using PHP as a WebAssembly binary, more information here: https://web.dev/articles/wordpress-playground#php_runs_as_a_webassembly_binary

@adamziel has talked about WordPress Playground a few times, but I don't know that he's ever explained how PHP and WebAssembly actually work.

Do you have specific questions?

danielbachhuber avatar Jun 09 '24 22:06 danielbachhuber

Do you have specific questions?

Not really, I just wanted to have a hint of where to look if I ever wanted to collaborate on this matter.

I think it could be great to be a maintainer.

Anyway, thank you so much for taking your time to answer me back.

lajennylove avatar Jun 09 '24 22:06 lajennylove

We can consider this issue closed as a PHP selector was incorporated in https://github.com/Automattic/studio/pull/225.

fluiddot avatar Jun 17 '24 15:06 fluiddot

Amazing! Thank you so much @fluiddot

lajennylove avatar Jun 17 '24 15:06 lajennylove