#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220

    Upgrade to php 7.1?


    Hi;

    I tried to upgrade to 7.1 and I think I did it.

    But php -v says I am using 5.5.27?

    What's going on?

    Here is the code:

    Code:
    ****-MacBook-Pro:/ ****$ curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
    Detected OS X Yosemite 10.10. All ok.
    Get packager.tgz
    Unpack packager.tgz
    Please type in your password, as we want to install this into /usr/local
    Start packager (may take some time) using /usr/bin/python2.7
    downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.1-10.10-frontenddev-latest.dat
    downloading https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/install/7.1-10.10/frontenddev/7.1-10.10-frontenddev-7.1.13-20180201-134129.tar.bz2
    
    Installing package 7.1-10.10-frontenddev into root /
    Package 7.1-10.10-frontenddev is already installed at version 7.1.13-20180201-134129. You wanted to install version 7.1.13-20180201-134129.
    Finished.
    
    
    
    
    *****s-MacBook-Pro:/ **********$ php -v
    PHP 5.5.27 (cli) (built: Jul 23 2015 00:21:59) 
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    *****s-MacBook-Pro:/ **********$
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,549
    Rep Power
    9645
    Uninstall the PHP 5.5 you have, undo whatever you did with 7.1, then reinstall 7.1.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    37
    Rep Power
    1
    Don't know about Macs, but maybe you need to define (either in .htaccess or Apache/PHP config file) which PHP version you want to use. It's possible to have multiple PHP versions installed on the same system, so maybe that's the case? If so, it looks your default one is set to 5.5
  6. #4
  7. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    This is the other thing.

    How many version of php is there on a pc?

    I have MAMP PRO and it is php 7.0
    Then I have another php located in /usr/bin/php which is php 5.5
  8. #5
  9. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    Originally Posted by requinix
    Uninstall the PHP 5.5 you have, undo whatever you did with 7.1, then reinstall 7.1.
    This is a bit scary. I don't want my sites on the local host to die. I doubt it will happen because I am using MAMP. I guess this means we can have MAMP and Otehr php on Macbook. Confusing. Shed some light?

    I have MAMP Pro. It says php 7.0

    I am not sure what is the deal with php 5.5 in /usr/bin/php

    Thanks
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    37
    Rep Power
    1
    Originally Posted by English Breakfast Tea
    This is the other thing.

    How many version of php is there on a pc?
    I don't know what's the max limit (if any), but it's surely possible to have 2. Obviously, only one can be default, so that might be the case. For example, I have PHP 7.x installed on my main server and it's set as default one, but I also have PHP 5.5 installed, which is used by some apps that I had no time to make PHP 7 compatible yet.
  12. #7
  13. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,147
    Rep Power
    4103
    You can have as many versions as you want, but it can be messy configuring them and only one of them can be the "default". I have 5.6, 7.0, 7.1 and 7.2 on my development box for different sites.

    Your 5.5 version probably came with mac os or you installed it at some point. I don't use mac so I have no idea how to handle it's applications but google found a way.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  14. #8
  15. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    Thanks for the replies.

    Still, one thing doesn't make sense (it's not you, it's me).

    Requinix suggested I uninstall php 5.5 and reinstall 7.1.

    I wonder why he/she said that since I can have multiple versions of php sitting on multiple locations of my computer.

    According to
    Package 7.1-10.10-frontenddev is already installed at version 7.1.13-20180201-134129. You wanted to install version 7.1.13-20180201-134129.
    Finished.
    Wouldn't a better advice be "Find out which php your application is using, then upgrade only that"?

    I can do this update as Requinix suggested and still have the same issue. Because the app might be using any of the phps on the computer.

    Thanks
  16. #9
  17. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,549
    Rep Power
    9645
    You can have multiple versions. But do you want that? Do you still need 5.5 for something?

    If so then yeah, go for multiple versions. You'll have to fiddle with stuff, like installing each version in a separate location and making sure the default binary (which you run by typing "php" in the terminal) is the one you want, but it's certainly possible.
  18. #10
  19. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    How can I tell which php is homebrew using?

    Does which php reflect on homebrew? My English sucks.
  20. #11
  21. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    PHP Code:
    brew instal homebrew/php/php72
    Updating Homebrew
    ...
    ==> 
    Installing php72 from homebrew/php
    Error
    Cannot install homebrew/php/php72 because conflicting formulae are installed.
      
    php71because different php versions install the same binaries
    BUT

    PHP Code:
    php --version
    PHP 5.5.27 
    (cli) (builtJul 23 2015 00:21:59

    So if 7.1 is installed, how come it says 5.5.27?
  22. #12
  23. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,549
    Rep Power
    9645
    Because you have both versions installed. I'm not a Mac person so I don't know why, but if it's anything like Linux then you might have 5.5 installed with one method (manually?) and 7.1 installed with another (Homebrew).

    As a guess, what happens if you try
    Code:
    $ php71 --version
  24. #13
  25. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    Originally Posted by requinix
    Because you have both versions installed. I'm not a Mac person so I don't know why, but if it's anything like Linux then you might have 5.5 installed with one method (manually?) and 7.1 installed with another (Homebrew).

    As a guess, what happens if you try
    Code:
    $ php71 --version
    php71 --version
    -bash: php71: command not found
  26. #14
  27. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,282
    Rep Power
    220
    Guess what!

    I did this
    Code:
    $ curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2
    Then I restarted and it worked. It now says 7.2

    But I really really wanna learn how this whole thing works.

    For example, if I make a php file on the Desktop, I wanna be able to set which php I use to parse it (parse.. is it the right word haha)

    How can I see all the phps installed without getting sucked away into computer science and partitioning and how binary code works.
    Trying to learn Laravel lol

    Thanks, Requnix as always you and Kicken are a blessing
    Last edited by English Breakfast Tea; February 6th, 2018 at 04:37 PM.

IMN logo majestic logo threadwatch logo seochat tools logo