Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joeylott's avatar

Latest Homestead Update Uses Different PHP Version for FPM and CLI...Need Help Installing Extension

I was running Homestead 3.1.0. Everything worked great.

Recently, when I destroyed and re-upped a vagrant instance, it updated to Homestead 4.0. That's when things broke.

And by "things", I mean that PHP-FPM is no longer finding the extensions I install. Specifically, pecl oauth.

I believe I can force vagrant to use 3.1.0 again, which may solve this problem, and I will give that a try in a moment.

But until that idea occurred to me, I have been trying to sort out the problem by sshing to the box and trying to figure out what happened.

When I run php-config from the command line, it tells me that it is running PHP 7.2. However, phpinfo() in a browser reports PHP 7.1.

I believe that what has happened is that Homestead 4.0 out of the box uses two different PHP versions for CLI v FPM. And when I sudo pecl install oauth from the command line, it is installing the extension for 7.2, not 7.1.

Unfortunately, that still didn't help me. I copied oauth.so from the 7.2/CLI extensions directory to the 7.1/FPM extensions directory. And I added extension=oauth.ini to the 7.1/FPM php.ini file, restarted all the relevant services, and still, no oauth being loaded by FPM.

Any ideas?

TIA.

0 likes
1 reply
joeylott's avatar

Forcing vagrant to use homestead 3.1.0 works. Now, cli and fpm are both using the same version and same extension directory and php.ini.

For reference, I added this to my Vagrant file, destroyed the instance, and upped a new one.

Vagrant.configure("2") do |config| config.vm.box = "laravel/homestead" config.vm.box_version = "3.1.0" end

Please or to participate in this conversation.