无法让Memcached在PHP中工作(Can't get Memcached working in PHP)
使用PHP memcached类时遇到问题。
我使用Apache 2.2.16和PHP 5.3.3在Ubuntu 10.10上运行LAMP环境。 我刚刚安装了我认为是memcached,但似乎可能是memcache?
我可以使用以下命令启动一个新的memcache对象:
$m = new Memcache;
哪些工作正常。 但是当我尝试并启动一个memcached对象时
$m = new Memcached();
我收到以下错误
Fatal error: Class 'Memcached' not found
当我运行'ps -A | grep Memcache'通过控制台,它会返回
ben@ben-computer:/tmp$ ps -A | grep memcache 1214 ? 00:00:00 memcached
显示正在运行的memcached进程。 phpinfo()返回memcache版本2.2.6。
但是当我进一步查看等文件夹
ben@ben-computer:/etc/default$ cat memcached # Set this to no to disable memcached. ENABLE_MEMCACHED=yes
然后当我运行php -m时,它会返回memcache。
你有这样的想法,我不知道为什么memcache运行而不是memcached,任何帮助都会很棒。
编辑:
我认为这可能是libmemcached的一个问题。 我安装了libmemcached-dev软件包,但不确定它是否相同?
Having issues using the PHP memcached class.
I am running a LAMP environment on Ubuntu 10.10 with Apache 2.2.16 and PHP 5.3.3. I have just installed what I thought was memcached, but seems possibly to be memcache?
I can start a new memcache object with:
$m = new Memcache;
Which works fine. But when I try and start a memcached object
$m = new Memcached();
I get the following error
Fatal error: Class 'Memcached' not found
When I run 'ps -A | grep Memcache' through the console, it returns
ben@ben-computer:/tmp$ ps -A | grep memcache 1214 ? 00:00:00 memcached
Showing a running memcached process. phpinfo() returns memcache version 2.2.6.
But when I look further into etc folder
ben@ben-computer:/etc/default$ cat memcached # Set this to no to disable memcached. ENABLE_MEMCACHED=yes
Then when i run php -m it returns memcache.
You kind of get the picture, i have no idea why memcache is running instead of memcached, any help would be great.
Edit:
I think it could be an issue with libmemcached. I installed the libmemcached-dev package, but not sure if that's the same?
原文:https://stackoverflow.com/questions/7665453
最满意答案
事实证明你需要在machine.config中定义
<sectionGroup>
元素 - 我不知道这一点。 例如,如果要在某处使用<Test>
键,则需要将其添加到machine.config中其他位置的相应部分,如下所示:<section name="Test" .../>
。 更多信息可以在MSDN上找到。Turns out you need to define
<sectionGroup>
elements in machine.config - I was not aware of that. E.g. if you want to use<Test>
key somewhere, you need to add it to the appropriate section elsewhere in machine.config like this:<section name="Test" .../>
. More info can be found on MSDN.
相关问答
更多-
自从我上次使用Inno Setup已经有一段时间了,但我认为你有两种可能性。 最好,也是最简单的方法是编写一个小的.exe应用程序,安装程序将在安装和卸载完成后运行: [Files] Source: "mconfig.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; [Run] Filename: "{tmp}\mconfig.exe"; Parameters: "/inst"; Flags: waituntilterminated runhidden ...
-
我最终在sharepoint之外创建了一个Web API解决方案,并与CSOM集成。 为了完成我原本想做的事情,我将不得不做很多头攻击并在SharePoint中解决并且希望它不会破坏。 I ended up creating a Web API2 solution outside of sharepoint and integrated with CSOM. In order to accomplish what I wanted to do originally, I would have had to ...
-
你应该先删除密钥,试试吧
-
事实证明你需要在machine.config中定义
元素 - 我不知道这一点。 例如,如果要在某处使用 键,则需要将其添加到machine.config中其他位置的相应部分,如下所示: 。 更多信息可以在MSDN上找到。 Turns out you need to define elements in machine.config - I was not aware of that. E. ... -
似乎Windows 8.1立即做到了。 我开始逐个更改所有machine.config文件。 当我查看framework 2.0 machine.config文件时,我在IIS管理器中看到它们。 似乎windows8.1 IIS管理器读取ans使用framework4值作为其默认(或左侧的顶级)机器配置。 但是Windows7 IIS管理器使用framework2.0作为默认值。 对我来说很奇怪。 无论如何结果是你需要更改所有machine.config文件。 您无法逐个查看任何应用程序池的“运行值”。 I ...
-
SharePoint 2013 - 匿名网站 - Chrome SharePoint插件(SharePoint 2013 - Anonymous Site - Chrome SharePoint Plugin)[2023-08-02]
这是由于SharePoint浏览器支持知识库文章中记录的Name.dll冲突。 要删除此警告,您有两个选择。 如果您不需要Web应用程序中任何网站集的此功能,则可以关闭一个名为“人员名称操作和状态设置”的Web应用程序常规设置。 Randy Drisgill的帖子在SharePoint 2010用户界面中有一个非常相似的屏幕截图。 或者,尝试按照Alex在同一主题的SuperUser线程中建议的方式修改母版页。 如果您不需要,请将以下JavaScript添加到母版页以禁用状态图标。 您很少在主要匿名访问的网 ... -
更新.net 4.0 machine.config似乎没有任何效果(Updating .net 4.0 machine.config seems to have no effect)[2023-07-02]
由于微软的奇迹把machine.config放在我想要的位置的几个位置: C:\ WINDOWS \ Microsoft.NET \ Framework64 \ v4.0.3031 \ CONFIG \ machine.config中 C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ CONFIG \ machine.config中 Due to the wonders of microsoft putting the machine.config a few lo ... -
在我的machine.config第10行仍然是开场评论的一部分。 你删除了吗? - >建议你可能没有删除结束的xml注释,或者你可能不小心删除了开放的xml注释令牌。 确保你有开头