php - 如何在 XAMPP mac osx lion 中设置内存缓存

标签 php macos memcached osx-lion xampp

如何在 XAMPP、Mac OSX Lion 中设置内存缓存。这在 Leopard 中非常简单(使用此链接 http://m-schmidt.eu/2010/03/30/develop-memcached-web-apps-with-xampp-under-mac-os-x/ ),但我安装了新的 Lion,似乎没有安装 memcache。

我在 https://gist.github.com/1301997 中试过这个但没有结果!!

任何人都可以建议做什么。

最佳答案

这就是帮助我使用 Mac OS X Mountain Lion、XAMPP 1.7.3 的原因(“pecl install”的标准方式不起作用,因为它编译64 位扩展,而 XAMPP 是在 32 位 模式下构建的)

(首先表明你没有安装这个如果你收到这种警告


    ...
    grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/main/php.h: No such file or directory 
    grep: /Applications/XAMPP/xamppfiles/include/php/php-5.3.1/php/Zend/zend_modules.h: No such file or directory
    ...

)

  • 我没有手动构建memcache 扩展,而是修改了PEAR 安装程序,添加了使用32 位 架构标志配置构建脚本的行:

    File: /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/Builder.php

    Was: 
    Line 323: // {{{ start of interactive part
    Line 324: $configure_command = "$dir/configure";
    Line 325: $configure_options = $pkg->getConfigureOptions();

    After modification:
    Line 323: // {{{ start of interactive part
    Line 324: $configure_command = "$dir/configure";
    Line 325: $configure_command .= " CFLAGS='-arch i386' APXSLDFLAGS='-arch i386' ";
    Line 326: $configure_options = $pkg->getConfigureOptions();

  • 然后我从终端执行了这个:

    cd /Applications/XAMPP/xamppfiles/bin
    sudo ./pecl install memcache

  • 重新启动 Apache 服务器

瞧!我有 php 内存缓存扩展工作!祝你今天过得愉快! :)

关于php - 如何在 XAMPP mac osx lion 中设置内存缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9744185/

相关文章:

node.js - 如何使用 electron 在 mac 的菜单栏中添加自定义菜单?

macos - mac 上的午夜指挥官文件位置

amazon-web-services - 在 aws-elasticache 上使用 memcached 或 Redis

php - 加载表单在同一个 div 中提交结果

regex - 如何在 unix (osx) 中搜索/替换一堆文本文件

python - 使用 Redis 与 memcached+db 作为 Django 的 session 系统的优缺点?

Redis 对比 Memcahced 对比 Hazelcast

php - 在指定数量的空格后换行

php - MySQL - 如果存在更新则插入介绍

php - 嵌入式 php css 文件不工作