本文介绍了有没有人让memcached在Laravel Homestead php7盒上工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新的Homestead php7框上加载了Laravel/Lumen,并遇到了以下错误:

I loaded up Laravel/Lumen on the new Homestead php7 box and encountered this error:

FatalThrowableError in MemcachedConnector.php line 51:
Fatal error: Class 'Memcached' not found

执行phpinfo();表示没有memcached扩展名,但是sudo service memcached status说memcached正在运行.似乎这里有一个用于memcached的php7分支: https://github.com. com/php-memcached-dev/php-memcached/tree/php7

Doing a phpinfo(); shows there is no memcached extension, but sudo service memcached status says memcached is running. It seems there is a php7 branch for memcached here: https://github.com/php-memcached-dev/php-memcached/tree/php7

有人可以指导我如何使其在新的php7 Homestead VM中工作吗?

Can anyone guide me on how to get it working in the new php7 Homestead VM?

我刚刚在宅基安装文档上看到,它说"Memcached(PHP 5 .x仅)".关于如何使其工作仍然存在疑问.

I just saw on the homestead install documentation that it says "Memcached (PHP 5.x Only)". Question still remains on how to get it working.

推荐答案

针对PHP7的php-memcached的工作尚未完成,并非所有测试都通过;我认为您可以使用除JSON序列化之外的所有功能.

The work on php-memcached for PHP7 is not yet complete, not all tests pass; You can use everything but JSON serialization, I think.

PHP7不支持pecl,因此现在您需要手动安装扩展,如下所示:

There is no pecl support for PHP7, so right now you need to install extensions manually, like this:

git clone https://github.com/php-memcached-dev/php-memcached
cd php-memcached
git checkout php7
phpize
./configure
make
sudo make install

您必须确保phpize是PHP7版本.另外,如果PATH中的php不是PHP7,那么PATH中的php-config也不是PHP7,在这种情况下,您必须将--with-php-config=/absolute/path/to/php7-config传递给./configure.

You must make sure that phpize is the PHP7 version. Additionally, if the php in your PATH is not PHP7, then the php-config in your PATH is not either, in this case you must pass --with-php-config=/absolute/path/to/php7-config to ./configure.

这篇关于有没有人让memcached在Laravel Homestead php7盒上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:17