laravel - osx terminal switches php-cli version
为情所困
为情所困 2017-05-16 16:56:45
0
1
455

I want to learn about Laravel recently

When executing composer update, error:mcrypt required

will be prompted.

After investigation, the PHP version of localhost is 5.6.2

Enter php -v in the terminal and the version displayed is 5.5.14

It is estimated that the problem is caused by different php versions

The osx used by localhost comes with apache and php

I have used brew to upgrade the php version before

Terminal use zsh

Execute the command in the terminal:

php -v get php 5.5.14

/usr/bin/php -v get php 5.5.14

/usr/local/php5/bin/php -v get php 5.6.2

I want to switch the terminal to php 5.6.2 version to install Laravel

How to switch the php version in the osx terminal to make it consistent with the environment version

Thank you so much~~~~(>_<)~~~~

为情所困
为情所困

reply all(1)
淡淡烟草味

brew info php55

底下有一块讲到这个:

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:

  export PATH="$(brew --prefix homebrew/php/php55)/bin:$PATH"
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!