I've attempted to upgrade my version of PHP to 7.3 by running:
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3
and then adding the new install to my PATH via the following line in my ~/.zshrc:
export PATH="/usr/local/php5/bin:$PATH"
I think that has worked adding it to my PATH as when I echo $PATH
it is the first item: /usr/local/php5/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/...
In my terminal when I run php -v
I get PHP 7.3.8 (cli) (built: Aug 11 2019 20:50:16) ( NTS )
but when I look at a phpinfo() file in my localhost it still says PHP 7.1:
I've read this could be because the apache server could be trying to use the version of php in /usr/bin
instead of the one in /usr/local/php5/bin
. But I can't work out how to change it to use the newly installed PHP 7.3.
If I run which php
it outputs /usr/local/php5/bin/php
.
My /etc/apache2/httpd.conf
file has the PHP 7 module loaded:
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php7_module libexec/apache2/libphp7.so