User Tools

Site Tools


sphp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sphp [2021/02/25 21:21] – создано chifeksphp [2023/09/14 06:06] (current) – external edit 127.0.0.1
Line 12: Line 12:
 brew install php@7.4 brew install php@7.4
 </code> </code>
 +
 +
 +Now you have to install sphp, you can do this with this script:
 +
 +
 +''curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp''
 +
 +Once it is downloaded in your computer just make it executable:
 +
 +''chmod +x /usr/local/bin/sphp''
 +
 +Cool, now restart your terminal and try to switch between versions with
 +
 +''sphp 7.4''
 +
 +<code>
 +Switching to php@7.4
 +Switching your shell
 +Unlinking /usr/local/Cellar/php@5.6/5.6.36… 0 symlinks removed
 +Unlinking /usr/local/Cellar/php@7.0/7.0.30… 0 symlinks removed
 +Unlinking /usr/local/Cellar/php@7.1/7.1.32_1… 0 symlinks removed
 +Unlinking /usr/local/Cellar/php@7.2/7.2.30_1… 0 symlinks removed
 +Unlinking /usr/local/Cellar/php@7.3/7.3.18… 25 symlinks removed
 +Unlinking /usr/local/Cellar/php/7.4.6… 0 symlinks removed
 +Linking /usr/local/Cellar/php/7.4.6… 24 symlinks created
 +You will need sudo power from now on
 +</code>
 +
 +Test your php version:
 +
 +<code>
 +php --version
 +
 +PHP 7.4.6 (cli) (built: May 14 2020 10:40:11) ( NTS )
 +Copyright (c) The PHP Group
 +Zend Engine v3.4.0, Copyright (c) Zend Technologies
 +    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies</code>
 +
 +I will be updating this article if I found some issues and some other troubleshooting tips.
 +
 +===== Troubleshooting =====
 +
 +
 +If the php version has not changed check first where does your php executable came from with, to work it should show something like this:
 +
 +<code>
 +which php
 +/usr/local/bin/php
 +</code>
 +
 +Check your ~/.bash_profile to be sure there no other php version loading after sphp. If there is some PHP loading just comment it, and restart your Terminal.
sphp.1614288074.txt.gz · Last modified: 2023/09/14 06:06 (external edit)