如何更改brew PHP目录

我一直在尝试设置一个Web应用程序超过10个小时</ p>

最困难的部分是设置Memcached </ p>

我使用php在这里找到了apache:</ p>

  /  Applications / XAMPP / xamppfiles / bin / php 
</ code> </ pre>

但后来我发现路由被破坏了,需要nginx
我设法以某种方式配置 nginx .conf </ code>但它不允许我现在安装Memcached。</ p>

  location~ \ .php $ {
root html;
include fastcgi.conf; \ n fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME / Applications / XAMPP / htdocs / rc $ fastcgi_script_name;
#include fastcgi_params;
} \ n </ code> </ pre>

这是我的 nginx.conf </ code>以及打开时运行的php版本 这个页面localhost是使用brew安装的那个。
当我使用 sudo brew services启动php71 </ code>时运行这个php版本
但是这个php版本不允许我安装memcached,我添加了memcached .so到phpinfo()中的extensions文件夹,并在php.ini中添加 extension = memcached.so </ code>行</ p>

有两种方法可以“修复” 这个问题:\没有以某种方式让memcached在使用brew的php71上工作或以某种方式使brew使用在XAMPP中找到的其他php </ p>
</ div>

展开原文

原文

I've been trying to set up a web application for over 10 hours now

The most difficult part in this was setting up Memcached

I got it working with apache using php found here:

/Applications/XAMPP/xamppfiles/bin/php

but then I found out the routing was broken and needed nginx so I managed to somehow configure the nginx.conf but it is not letting me install Memcached now.

      location ~ \.php$ {
        root           html;
        include        fastcgi.conf;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        #fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param  SCRIPT_FILENAME  /Applications/XAMPP/htdocs/rc$fastcgi_script_name;
        #include        fastcgi_params;
    }

This is my nginx.conf and the php version that is ran when opening this page localhost is the one that was installed using brew. This php version runs when I use sudo brew services start php71 but this php version doesn't let me install memcached, I have added the memcached.so to the extensions folder found in phpinfo() and added the extension=memcached.so line in php.ini

There are 2 ways to "fix" this issue: one is somehow getting memcached to work on php71 with brew OR somehow making brew use the other php found in XAMPP

dops57958
dops57958 我不只是尝试升级或降级php,而是试图链接到一般的不同目录:/Applications/XAMPP/xamppfiles/bin/php
接近 2 年之前 回复
dongshenjie3055
dongshenjie3055 试试这个github.com/philcook/brew-php-switcher
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐