Mac/OSx-更改bash中调用的PHP版本 [英] Mac / OSx - Change PHP version which is call in bash

查看:66
本文介绍了Mac/OSx-更改bash中调用的PHP版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用bash命令"php"调用PHP时遇到问题:

使用bash:

php -v#PHP 5.3.17

/usr/bin/php#PHP 5.3.15

我主要希望使用辅助PHP版本5.3.15,因为在此版本中,我已经正确安装了扩展程序等.

当调用" php -v "返回我的5.3.15版本时,如何设置/usr/bin/php 为main->我想要. >

请原谅我的英语不好,希望您能理解.

非常感谢. 我有Mac OSx Lion

解决方案

我建议您通过"Mac端口"安装php.

您已经安装了多个版本的php.

使用cli命令哪"可以:

说明 哪个实用程序获取命令名称列表并搜索每个可执行文件的路径 如果实际调用了这些命令,它将可以运行.

因此,请阅读cli命令其中"的手册页.

在您的cli中执行此操作:

哪个php

,然后您将看到php可执行文件位于何处.我建议您将php可执行文件替换为/usr/bin/php的符号链接.

I have a problem with PHP which is call through bash command "php":

In bash:

php -v # PHP 5.3.17

/usr/bin/php # PHP 5.3.15

I want secondary PHP version 5.3.15 as mainly, because in this version I have correctly installed extensions etc.

How can I set /usr/bin/php as main -> I want when call "php -v" return my 5.3.15 version.

Execuse my bad English, I hope that you understand.

Thank you so much. I have Mac OSx Lion

解决方案

I would recommend you to install php through "Mac Ports".

You have multiple versions of php installed.

With the cli command "which" you can:

DESCRIPTION The which utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked.

So read the man pages of the cli command "which".

DO this from your cli:

which php

and then you will see where is located your php executable. What i would recommend you is to replace your php executable for a symbolic link to your /usr/bin/php.

这篇关于Mac/OSx-更改bash中调用的PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆