Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: different PHP versions #2656

Closed
norcross opened this issue Feb 1, 2023 · 7 comments
Closed

Bug: different PHP versions #2656

norcross opened this issue Feb 1, 2023 · 7 comments
Labels

Comments

@norcross
Copy link

norcross commented Feb 1, 2023

Are you using the latest stable or develop branch version of VVV?

Yes (develop)

Is it a new VVV, or an existing VVV that used to work?

Existing, worked but now broken

Did you use a CustomFile?

No (default)

Whats the problem?

i apologize if this has been covered somewhere else, but i'm running into an issue where i have PHP 8.0 set in my config file and the site is correctly loading with it, however, the related WP-CLI is still running on 7.4.

i saw the discussion here, but didn't see anything on how to actually change which version is running inside the SSH / CLI.

I have functions that are new to PHP 8 that are throwing errors when the function is run via CLI

How do we reproduce it?

No response

What is the output of vagrant status

__ __ __ __
\ V\ V\ V / v3.11 Ruby:2.7.6, Path:"/Users/norcross/vagrant-local"
 \_/\_/\_/  git::develop(fb684b5)

Platform: darwin19 shell:/bin/zsh vagrant-goodhosts vagrant-vbguest shared_db_folder_disabled
Vagrant: v2.3.4, virtualbox: v6.1.40

Which Operating System are you using?

Apple MacOS (Intel)

Which provider are you using?

VirtualBox 6

@welcome
Copy link

welcome bot commented Feb 1, 2023

Thanks for opening your first issue here! Be sure to follow the issue template and include your OS/Vagrant/VVV versions! Don't forget you can get support in the VVV slack at https://varyingvagrantvagrants.org/docs/en-US/slack/

VVV
Join the VVV Slack Workspace

@norcross
Copy link
Author

norcross commented Feb 1, 2023

if it matters, my OS is running PHP 8.2 itself

@tomjn
Copy link
Member

tomjn commented Feb 1, 2023

@norcross do you have PHP set to 8.2, or do you have the nginx upstream set to PHP 8.2? And is this via vagrant shell or during provisioning?

@norcross
Copy link
Author

norcross commented Feb 1, 2023

sorry for the lack of clarity. here is the settings:

OS (Mac 12.6.2) : 8.2.0
Vagrant site (via config.yml): 8.0.27
WP CLI in Vagrant: 7.4.33

@tomjn
Copy link
Member

tomjn commented Feb 1, 2023

@norcross for provisioning it should be enough to declare php: 8.0 for the site, nginx_upstream is obsolete for that, though still useful if you wanted to mess around with extensions and custom upstreams, e.g. if you wanted to install experimental PHP FPM's or stuff like HHVM

As for SSH'ing manually into the VM, it'll use the default by default, you would need to do one of the following:

If you do take the second route, remember to reset the version afterwards, changing it isn't a per shell session thing, it's a system wide thing that takes effect until it's next changed. Re-provisioning will probably reset it back to 7.4 but there's a chance something expecting 7.4 will get 8.0 by accident and fail before then

GitHub
An open source Vagrant configuration for developing with WordPress - VVV/vvv_restore_php_default at develop · Varying-Vagrant-Vagrants/VVV

@tomjn
Copy link
Member

tomjn commented Feb 1, 2023

In the meantime, I'm hoping to bump the default to 8.0 soon

@norcross
Copy link
Author

norcross commented Feb 1, 2023

thank you! changing the default for now is likely the route i will take if you're gonna update the default here soon anyway. checking some notes i had, i apparently did this a while ago and forgot about it, which would explain why i didn't get errors until now.

@norcross norcross closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants