How can I change the PHP version

I setup a number of sites yesterday using the “Preferred” method. Today I realized that the “Preferred” method only uses PHP 5.6 and I’d like to run 7.1.x.

Can I change the PHP version after I setup a site with the “Preferred” method?

The “Preferred” method does not give me the same options as “Custom” does in regards to changing the PHP version. Right now, I don’t appear to have any options.

1 Like

Hey Thomas,

PHP 7.1 on the Preferred environment is in the pipeline.

In the meantime the easiest way to get your site onto 7.1 is to right-click on the site in Local and export it. Then, re-import it and select the “Custom” environment and then PHP 7.1.

Thanks for the update.

Curious as to why “Preferred” sites don’t have options to change settings like “Custom” ones do. That’d be handy.

1 Like

The Preferred environment is meant to be a simple environment that best matches the Flywheel production environment. All of the components are baked directly into the Preferred environment.

The Custom environment (what Local originally started with) is a more flexible environment where the components (nginx, Apache, nginx, MySQL, etc) are brought into the container when needed.

Thanks. Appreciate the answers.

Hi,

I too am having an issue in trying install php >=7. I have exported and re-imported my site and after having chosen v 7.1.4 via WP CLI (via wp --info) is telling me that I still have version 5.6.30 installed (even though the Flywheel interface is telling me that I have 7.1.4). How can I fix/troubleshoot this problem? I am trying to use a Sage template which requires php >=7.

Thanks in advance!

@juliette,

Can you try spinning up a brand new site with 7.1.4 and then check if you run into the same issue?

Sorry for the trouble!

Hi @clay,

Thanks for the quick response! I have tried that already and the same thing happens.

Ah, you might be using your computer’s PHP version.

You can “SSH” into the site container by right-clicking on the site in the sidebar and then going to “Open Site SSH”


If that’s not the case, can you provide a quick sequence of screenshots or audio-less screencast showing what’s happening?

Oh, I hadn’t thought of that! Let me try that. Be back in a minute.

I just realized that I did not specify that I am using zsh when installing a new site. Could that be why this is happening?

When I “Open Site SSH” I get this in the shell:

Library/Application\ Support/Local\ by\ Flywheel/ssh-entry/S1C7A6nd-.sh ; exit;
-n -e
root@3e871e59a918:/#

Yup! That’s what you should be seeing.

When you “SSH” into a site, you’re actually entering the bash process in the site’s Docker container. Once that’s open, you can run commands and anything you run will be ran inside the site’s container.

zsh shouldn’t matter. I use and love zsh :smiley:

I love zsh too!

What do I need to do (to update my PHP version) when I “SSH” into a site?

Thanks :sunny:

When you run wp --info in the site SSH are you still seeing PHP 5 instead of PHP 7?

It says that the site is using php -v 7.1.4!

Interesting. It must be an issue with the latest (beta) version of the Sage starter theme (?) because when I ran composer install from the theme directory it kept telling me that I needed to upgrade to php >= 7. Or maybe it’s not Sage at all. Maybe it’s an issue with the WP CLI… hmmmmmmm…

Or maybe I should have run composer install after opening “site SSH”… I’m going to try that.

1 Like

Thank you again Clay. Flywheel rocks!

1 Like

I set up a Custom environment, but still the dropdown doesn’t show. The “development mode” toggle also decides to appear sometimes but now I can’t get it to appear anywhere.

Everything seems really shaky on High Sierra :frowning:

Hey Scott,

Are you on 2.0.8 or newer with High Sierra?

If so, can you provide a screenshot of what you’re seeing?

Is “Dev Mode” only available for Preferred, but not Custom local environments? I’m only seeing the toggle when it’s Preferred it looks like.

Hey Scott,

Yes, Dev mode is only on Preferred. Personally I use the Custom environment for everything, so I can switch web servers and PHP versions.

My understanding of the Dev Mode switch is to turn off the Redis cache, which is only present in the Preferred environment.

1 Like