R
R
romaaa322018-07-23 21:50:53
PHP
romaaa32, 2018-07-23 21:50:53

Why won't Memcached start?

Why doesn't Memcached start in classes?
For example if

$m = new Memcached();
        $m->addServer('localhost', 11211);
in a regular file enter works, but if it's in a class
class aaa
{

    public function __construct($id)
    {
        $m = new Memcached();
        $m->addServer('localhost', 11211);
gives an error message
Fatal error: Uncaught Error: Class 'modules\Memcached' not found in /var/www/html/modules/aaa.php:4

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-07-23
@romaaa32

gives an error message

Of course, I will not read the error, and show it too

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question