Switch to PHP 7.3 Easily

New PHP 7.3+ has been released for a couple of months now and if you're interested in upgrading, the process is very simple.



Note : This guide is for MAC users.

Let's update everything
To pull install or update any applications or services, I use a Mac OS package manager called Homebrew. Before we go about upgrading our PHP installation,
lets' quickly run a Homebrew commands to update our formulae and Homebrew itself.


$ brew update

Upgrading PHP
Now that our formulae is updated, we can proceed to upgrade our PHP installation with the latest version available on Homebrew.


brew upgrade php
or
brew install php@7.3

After the upgrade completes, you can open a new tab in your terminal and check your PHP version with php -v. If all went well, you should see something like this:


PHP 7.3.3 (cli) (built: Dec  7 2018 11:00:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies

write a simple php code to check version,


<?php phpinfo();?>

In only a couple of minutes, you're already upgraded to the latest version of PHP.

For Laravel Users,

Using Laravel Valet, In order to get Valet working on PHP 7.3, you simply need to update it to the latest version released.

Just do a composer global update to update all your globally installed Composer packages and then just do a valet install.

Running valet install again is necessary to configure the installation to work with your new PHP version.

Post a Comment

Post a Comment (0)

Previous Post Next Post