简体   繁体   English

在OSX Mavericks上协调PHP版本

[英]Reconciling Php Version on OSX Mavericks

I have recently upgraded my OSX to Mavericks. 我最近将OSX升级到了Mavericks。 Before the upgrade I had two copies PHP version 5.3. 在升级之前,我有两份PHP版本5.3。 One was running for Apache and one for Command line. 一台针对Apache运行,另一台针对命令行运行。 This was fine, until after the upgrade I now have PHP 5.4 running on Apache BUT still have 5.3 running for command line. 很好,直到升级后,我现在在Apache BUT上运行的PHP 5.4仍在命令行中运行5.3。 I need to bring these to the same version. 我需要将它们带到相同的版本。 Worst case, I would get a new copy of 5.4 running for command line, and best case I would just configure the command line to use the pre installed copy of php. 最坏的情况是,我将在命令行中运行5.4的新副本,最好的情况下,我将配置命令行以使用预安装的php副本。 I have tried to add the folder location for my apache copy of php to my path, but it didn't work. 我试图将我的apache副本的php的文件夹位置添加到我的路径,但是没有用。 Any help on this would be appreciated. 任何帮助,将不胜感激。 Thanks! 谢谢!

Ok I got it. 好,我知道了。 I couldn't find this answer anywhere so hopefully this will be helpful to someone. 我在任何地方都找不到此答案,因此希望这会对某人有所帮助。 I created test.php with 我用创建了test.php

echo exec("which php");

And ran that. 并运行。 Then I ran 然后我跑了

which php 

from the command line. 从命令行。 Then I made the symlink which from command line point at the location found by looking at test.php with my browser. 然后,通过使用浏览器查看test.php,从命令行指向指向找到的位置的符号链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM