Skip to content

Instantly share code, notes, and snippets.

@vikbert
Last active April 6, 2019 07:09
Show Gist options
  • Save vikbert/13daff901f70ce486ed85e717ba2db8a to your computer and use it in GitHub Desktop.
Save vikbert/13daff901f70ce486ed85e717ba2db8a to your computer and use it in GitHub Desktop.
[php HowTo] install php 7.1 #web, #web-dev,

show php.ini

php --ini

Interactive PHP debugger

  • install psysh
composer g require psy/psysh:@stable
ln -s ~/.composer/vendor/bin/psysh /usr/local/bin/psysh
psysh

download the php_manual.sqlite and copy file to ~/.local/share/psysh/

Install php 7.1 on ubuntu

sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip

Install php 7.1 on XOS

more read on mac OS php71 became php71 with brew

# Reinstall PHP 7.1
brew reinstall php@7.1

# check carefully that overwriting links won't break things
brew link --overwrite --force --dry-run php@7.1

# Run it for real this time assuming you checked
brew link --overwrite --force php@7.1

# Double check that you are now using homebrew's PHP
which php

# This should identify any missing extensions
php -v

# Reinstall missing extensions. In my case:
brew reinstall php71-xdebug php71-imagick

# Check that php can find the extension.
php -v

How to Switch PHP version on XOS

$ curl -L https://gist.githubusercontent.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw > /usr/local/bin/sphp
$ chmod +x /usr/local/bin/sphp
$ sphp 7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment