WP theme is referencing composer's PHP instead of Local's PHP version

I had installed composer on my Mac. With it, it installs PHP v8.3. In Local I have set up a WP site that uses an older Sage theme which utilizes composer for installs. However, when I run composer install inside the theme, it barks at me:

 Problem 1
    - illuminate/support[v5.6.0, ..., v5.6.39] require php ^7.1.3 -> your php version (8.3.0) does not satisfy that requirement.
    - Root composer.json requires illuminate/support 5.6.* -> satisfiable by illuminate/support[v5.6.0, ..., v5.6.39].

It won’t install dependencies. Even though my Local project uses php 7.3, it’s still referencing the php version composer installed which is probably a bad idea to force uninstall.

So how can I get around this. Why isn’t my theme recognizing Local’s php version?

There is an older comment here you could try:

Thanks @Nick-B! I’ll try that if there’s every a next time.
I had ended up installing Herd. Herd goes as far back as supporting 7.4. The default PHP version in Herd seems to take precedence over Composer’s version. In the end, I as able to install packages for my old PHP project.

1 Like

Okay thank you for the follow up @djmtype! Glad you found a workflow that allowed you to proceed.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.