I am using homestead_improved to do php development. I see the latest php version (7.3.x) installed when I do php -v on command line. However, when I run phpinfo() from inside a php script in the ‘public’ folder I see the php version being used as 7.0.x.
I see the option of going into /etc/nginx/sites-enables and changing the php version in each app that I have created. But that is cumbersome.
Question is: How do / what do / where do I make changes so that the nginx server uses the latest php version by default?
Hi @rpkamp, thanks for replying.
I tried that, halted the vm, restarted it and checked; still php 7.1 ( I had said 7.0 by mistake)
Additionally, when I do nano homestead.app (one of the sites) it says file is not writable!
Also, my nginx.conf is a sym-link to “/home/vagrant/.config/nginx/nginx.conf” … and when I open that, it is completely empty!
Yes, I did change the command to ‘s/php7.1/php7.3/g’ … and did use sudo … still, no go.
On one of the sites I read a suggestion to modify “serve-hhvm.sh” in the scripts folder. I did that but I can’t seem to execute the .sh script within vagrant/homestead_improved. It says permission denied. If I try with “sudo” it says command not found. If I try to go root with “su” it is asking for the password and I can’t seem to figure out the password.
May I ask you this; I am at the learning stage in php development. nginx is using php 7.1.33. Are there any significant differences / disadvantages to using php 7.1.33 over php 7.3.6? In other words, if I use the setup as is, will I be missing out on something important?
Appreciate your help, especially your explaining the parts of the script.
Oh! Hello! Your hint on using ‘sudo’ to modify the unwritable files did the trick!
I did ‘sudo nano homestead.app’ and changed the line manually to 7.3.
Is that a good-enough solution?
phpinfo(); is now showing “PHP Version 7.3.6-1+ubuntu18.04.1+deb.sury.org+1”
IMHO they’re worth at least a quick scan but rather that trying to “learn” them a better approach is to always develop with full error reporting enabled.
You might want to keep in mind that 7.1 goes EOL (End Of Life) later in year (Dec 1st 2019). What that basically means is the PHP Group (who create and maintain PHP versions) won’t be offering any support for 7.1 after that date
Thanks @SpacePhoenix for the heads up. I will be sure to check the versions on all apps from now on.
Trying to solve this issue also made me realize I should have some knowledge of shell scripting as well. I do use Linux Mint as my main machine but never bothered to go beyond the basic commands. If I am going to be using Linux VMs to develop, might as well learn to deal with scripts.