memcache扩展缺失 - 如何安装? MAMP 4.2

时间:2017-08-15 06:37:03

标签: mamp mamp-pro

现在MAMP有一个memcached服务器很棒,我发现它有一个memcached扩展名。

我们使用memcache扩展,虽然我能够使用PHP 5.x轻松配置它,因为有很多指南我似乎无法在MAMP Pro 4.2上使用PHP 7.0.20。

有谁知道如何让MAMP Pro 4.2使用memcache扩展而不是memcached扩展?

1 个答案:

答案 0 :(得分:1)

我在PHP 3.0.8的MAMP 3.5.2上遇到了与memcache和memcached模块相同的问题,并且能够从源代码安装这两个模块。对于memcache,我使用了websupport-sk git repo。使用它需要您自担风险。以下是 memcache 安装

所遵循的步骤
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:orientation="vertical"
android:padding="3pt">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/background"
    android:orientation="horizontal">

    <ImageView

        android:id="@+id/ivFoodImage2"
        android:layout_width="50pt"
        android:layout_height="50pt"
        android:layout_weight="1"
        app:srcCompat="@drawable/a" />

    <LinearLayout

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical"
        android:padding="2pt">

        <TextView
            android:id="@+id/tvName2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Coffee"
            android:textSize="18sp" />


        <TextView
            android:id="@+id/tvDes2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Could be prepare with suger" />
    </LinearLayout>
</LinearLayout>
</LinearLayout>

将以下行添加到php.ini

sudo su
cd /private/tmp
wget https://github.com/websupport-sk/pecl-memcache/archive/NON_BLOCKING_IO_php7.zip
unzip NON_BLOCKING_IO_php7.zip
cp -r pecl-memcache-NON_BLOCKING_IO_php7 /Application/MAMP/bin/php/php7.0.8/include/php/ext/memcache
cd /Application/MAMP/bin/php/php7.0.8/include/php/ext/memcache
phpize
./configure --enable-memcache --with-php-config=/Application/MAMP/bin/php/php7.0.8/bin/php-config
make
cp modules/memcache.so /Applications/MAMP/bin/php/php7.0.8/lib/php/extensions/no-debug-non-zts-20151012/memcache.so

希望这有帮助!

相关问题