Installing the PHP "memcached" Extension on OS X 10.9 Mavericks / 10.10 Yosemite / 10.11 El Capitan

Updated Instructions (Oct 2015):
This has been tested in OS X El Capitan and works there as well!

Note: If you are running OS X El Capitan you will need to first turn off "System Integrity Protection" aka "rootless" for these directions to work.

To disable System Integrity Protection, boot into recovery mode by restarting and then holding ⌘R as you hear the startup chime. Then start the Terminal from the Utilities menu.

Run the following command

$ csrutil disable

Then reboot. You are good to go.

If you wish to turn it back on, which you probably should when you are done, follow the instructions above but instead use:

$ csrutil enable

The first step is to install the latest and greatest Xcode.

Install the Xcode developer tools. Apple seems to have removed this option from the preferences so you'll need to handle this from the command line.

$ xcode-select --install

Next we will install the required dependencies. If you are not already using Homebrew you should be.

$ brew install wget autoconf pkg-config libmemcached

You will also want to make sure you have PEAR installed; instructions can be found here but can be summarized as follows:

$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar

Then in the /tmp directory we will create a folder we can work in.

$ cd /tmp
$ mkdir memcached-work
$ cd memcached-work

Then we will use pecl, part of pear, to fetch the current version of the extension. The version of the memcached extension will vary so you may need to update your paths accordingly.

$ pecl download memcached
$ open memcached-{{version}}.tgz
$ cd memcached-{{version}}/memcached-{{version}}
$ phpize
$ ./configure
$ make
$ sudo make install

Finally you will need to add the following line to your php.ini

extension = memcached.so

You can verify your installation with the following:

$ php --info | grep memcached\\.

Depending on your setup now you may want to restart apache.

$ sudo apachectl restart

You should be all set to go! Godspeed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]和\[2\]中的信息显示,在安装go插件时,VSCode会提示安装其他插件。然而,根据引用\[1\]和\[2\]中的错误信息,安装golang.org/x/tools/cmd/goimports@latest插件失败了。这可能是由于网络连接问题或插件源的不稳定性导致的。为了解决这个问题,你可以尝试以下几个步骤: 1. 确保你的网络连接正常,可以尝试重新安装插件。 2. 检查你的防火墙或安全软件设置,确保它们不会阻止插件的下载和安装。 3. 尝试使用代理服务器来下载和安装插件,有时候使用代理服务器可以解决网络连接问题。 4. 如果你使用的是公司或学校的网络,可能存在网络限制,你可以尝试在其他网络环境下安装插件。 另外,引用\[3\]中的信息显示,你可以尝试切换到GOPATH目录,并使用命令"go install github.com/josharian/impl@latest"和"go install github.com/ramya-rao-a/go-outline@latest"来手动安装这两个插件。这样可以绕过VSCode的安装过程,直接使用go命令来安装插件。 希望这些步骤能够帮助你解决安装golang.org/x/tools/cmd/goimports@latest插件失败的问题。如果问题仍然存在,请尝试在go相关的论坛或社区寻求帮助,以获取更详细的解决方案。 #### 引用[.reference_title] - *1* *3* [VSCode安装go相关插件失败的解决方案](https://blog.csdn.net/mlwise/article/details/124874882)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [一招完美解决vscode安装go插件失败问题](https://blog.csdn.net/qq_41065919/article/details/107710144)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值