Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.

SOLVED memcached server and php-memcached

  • @girish I have

    root@659d2867-1273-4c51-b7e7-765edf705c2d:/app/data# supervisorctl status
    apache2                          RUNNING   pid 19, uptime 1 day, 22:13:15
    cron                             RUNNING   pid 18, uptime 1 day, 22:13:15

  • @girish I think I did selected the correct branch, because when I do git branch I have this

    And I did the build and the install from this branch.

    I probably did something wrong tho since memcached is not even running and the test put in place by the devs goes like this :
    Fatal error: Uncaught Error: Class 'Memcached' not found in /app/data/public/index.php:24 Stack trace: #0 {main} thrown in /app/data/public/index.php on line 24

    if (!$connection = pg_connect ("host=".getenv("CLOUDRON_POSTGRESQL_HOST")." dbname=". getenv("CLOUDRON_POSTGRESQL_DATABASE") ." user=" . getenv("CLOUDRON_POSTGRESQL_USERNAME")." password=" .getenv("CLOUDRON_POSTGRESQL_PASSWORD") ."")) {
        $error = error_get_last();
        echo "Connection to the PostgreSQL database failed. Error was: ". $error['message']. "\n";
    } else {
        echo "Connected to the PostgreSQL database.\n";
    $memcached = new Memcached();
    $memcached->addServer('', 11211);

  • I got this from the devs of the custom web app :

    So far: postgresql and memcached servers available - OK;
    Missing: php-memcached extension (so I can't make use of the memcached server capabilities within a php script) - not OK

    Please also don't forget about nginx x-accel, can you add an entry to the nginx conf file for that?

    Not sure how to proceed

  • by inspecting php.ini in the container, I went to the extension section and added

    Aug 31 14:29:58 PHP Warning: PHP Startup: Unable to load dynamic library 'memcache' (tried: /usr/lib/php/20180731/memcache (/usr/lib/php/20180731/memcache: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/ (/usr/lib/php/20180731/ cannot open shared object file: No such file or directory)) in Unknown on line 0

    So does this mean the memcache server is not properly installed ?

  • Staff

    I think the image you are using is wrong. php-memcached is also installed in the same patch as memcached itself -

    Can you tell me the command you used to build and update the image? Also, what is the CLI version ? It should be 4.5.2.

    $ cloudron --version

  • @girish I'm on 4.5.2
    the command I used after git clone
    was cloudron build --local
    then cloudron install
    and that's it..

  • Staff

    @rmdes Can you try cloudron exec and then check if /etc/supervisor/conf.d/memcache.conf exists? Otherwise, you are not using the correct build (not sure where the problem could be though).

  • @rmdes said in memcached server and php-memcached:

    supervisorctl status



  • Not sure what happened to my original git clone folder but by downloading the zip file from the memcache branch and then doing cloudron build --local & cloudron install I got it working !

  • @girish said in memcached server and php-memcached:


    Confirm this exists now 🙂

    output of echo "stats settings" | nc localhost 11211


Log in to reply