在我的mac上安装带有自制软件的php 71时出错

I have been developing with Vallet for some time now. Today i wanted to update laravel 5.4 to 5.5. Before doing so i run composer global update. Causing Vallet to stop working.

Fist i tried to do the following:

cd ~/.composer/

sudo chown -R $(whoami) vendor

source: https://laracasts.com/discuss/channels/general-discussion/getting-valet-not-found-error

I did not solve the issue. Then i decided to reinstall Vallet. Hereby i did the following:

I followed this: https://github.com/laravel/valet/issues/321

Stop and uninstall services

sudo brew services stop php71 dnsmasq nginx
brew uninstall php71 dnsmasq nginx

Remove related config files and valet home folder

sudo rm -r /usr/local/etc/php /usr/local/etc/nginx /usr/local/etc/dnsmasq.conf
sudo rm -r ~/.valet /var/root/.valet

Install services i tried this:

brew install php71
$ brew tap homebrew/php
$ brew install php71
brew install homebrew/php/php71 

All gave the following error:

MacBook-Pro:~ mblivier$ brew install homebrew/php/php71 
==> Installing php71 from homebrew/php Error: The following formula: php71 
cannot be installed as a binary package and must be built from source.

Install the Command Line Tools:xcode-select --install

I new in this and don't know how to solve this. Any suggestions how to install php and go further with reinstalling Vallet?

  • homebrew is installed and working

2个回答



你需要xcode来构建php,所以首先运行:</ p>

  xcode-select  --install 
</ code> </ pre>

安装xcode以后可以 brew install php71 </ code> </ p>
</ div>

展开原文

原文

You need xcode to build php, so first run:

xcode-select --install

to install xcode and later you can brew install php71

douhuan1979
douhuan1979 谢谢你的反应。 我做到了。 还修改了brew安装php71并启动了php71。 MacBook-Pro:应用程序mblivier $ brew服务启动php@7.1 ==>成功启动php @ 7.1(标签:homebrew.mxcl.php@7.1)。 但是,当我问php -v我带回-bash:/ usr / local / bin / php:没有这样的文件或目录。 有什么我做错了吗?
大约一年之前 回复
dongzhuange2625
dongzhuange2625 谢谢你的反应。 我做到了。 还修改了brew安装php71并启动了php71。 MacBook-Pro:应用程序mblivier $ brew服务启动php@7.1 ==>成功启动php @ 7.1(标签:homebrew.mxcl.php@7.1)。
大约一年之前 回复



这是您的评论的答案,我不能发表评论,需要发帖因为长度有限 。</ em> </ strong> </ p>

这里有两件事情中的一件,要么你没有安装PHP,要么安装了PHP而且当前没有任何系统感知 路径。 首先,我会尝试找到PHP并确保它存在:</ p>

  $ find / -name php -type f 
</ code> </ pre>

你应该看到类似的东西:</ p>

  / path / to / your / php / bin / php 
</ code> </ pre>

< p>如果确实存在PHP二进制文件,请检查您的路径:</ p>

  $ echo $ PATH 
</ code> </ pre>

如果确实如此 不存在,重新编译php。</ p>

如果您的系统上存在PHP,请确保包含/ bin / php文件的路径。 您可以编辑〜/ .bash_profile </ code>并添加如下自定义路径:</ p>

  PATH = $ PATH:/ path / to / your / php  / bin / 
....
export PATH
</ code> </ pre>

然后保存并重新加载文件以确保您当前的会话可以访问新的路径更改:</ p >

  $ source~ / .bash_profile 
</ code> </ pre>

运气好的话,你现在可以做 php -v </ 代码>并查看版本响应。</ p>
</ div>

展开原文

原文

This is answer for your comment, I can't post as comment, need to post because is length limited.

There is one of two things going on here, either you didn't install PHP, or PHP is installed and not currently in any of system aware paths. First I would try to find PHP and make sure it exists:

$ find / -name php -type f

You should see something like:

/path/to/your/php/bin/php

If PHP binary does exist, check your path:

$ echo $PATH

If it does not exist, recompile php.

If PHP exists on your system, make sure the path to the /bin/php file is included. You can edit your ~/.bash_profile and add the custom path like this:

PATH=$PATH:/path/to/your/php/bin/
....  
export PATH

Then save and reload the file to ensure your current session has access to new path changes:

$ source ~/.bash_profile

With any luck you can now do a php -v and see the version response.

doujiaoang69440
doujiaoang69440 root,谢谢你的反应。 我有php工作。 感谢你目前的帮助。 在此之后,我遇到了另一个问题。 我也为它创建了一个问题。 你也知道解决方案吗? 提前致谢! stackoverflow.com/questions/57494486/laravel-valet-wont-install
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问