简体   繁体   中英

Botman PHP 7.2.4 opcache

I am tring to get a simple conversation working and the response fails, I need to know how to use opcache with botman and php 7.2.4 - WAMP

I have modified the php.ini file adding the zend_extension setting, following the documentation I have use:

use BotMan\BotMan\Cache\DoctrineCache;

$botman = BotManFactory::create($config, new DoctrineCache($doctrineCacheDriver));

This gives and undefined variable: doctrineCacheDriver error

The function uses a $driver variable, is there additional settings that need to be configured.

Any help setting up cache, php 7 on wamp, would be much appreciated.

If you are still looking for an answer to this or someone in the future follow the following steps.

  1. Install APCu on Windows (WAMPP/XAMPP) using this guide .
  2. Run composer require doctrine/cache from your CLI inside your project/ app directory

Then make an instance of the cache class/driver

$doctrineCacheDriver = new \Doctrine\Common\Cache\ApcuCache();

Thats when you can pass it to BotmanFactory as the as a parameter like below

$botman = BotManFactory::create($config, new DoctrineCache($doctrineCacheDriver));

You were getting that error because the

$doctrineCacheDriver

was not defined

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM