• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Issue How to install Memcache PECL extension for PHP (not Memcached)

  • Thread starter Deleted member 209767
  • Start date
D

Deleted member 209767

Guest
Server operating system version
CentOS 8.5.2111 x86_64
Plesk version and microupdate number
Plesk Obsidian 18.0.41.1
I already have Memcached installed and running
1669432975222.png

But now I need to install the Memcache (not Memcached) PECL extension for PHP in order to use this plugin:

I tried this:
Code:
yum install php74-php-pecl-memcache.x86_64

Then I follow the instructions but as soon as I upload object-cache.php it breaks the site with this error in the logs:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'Memcache' not found in /var/www/vhosts/domain.net/public_html/wp-content/object-cache.php:987\nStack trace:\n#0 /var/www/vhosts/domain.net/public_html/wp-content/object-cache.php(100): WP_Object_Cache->__construct()\n#1 /var/www/vhosts/domain.net/public_html/wp-includes/load.php(730): wp_cache_init()\n#2 /var/www/vhosts/domain.net/public_html/wp-settings.php(131): wp_start_object_cache()\n#3 /var/www/vhosts/domain.net/public_html/wp-config.php(105): require_once('/var/www/vhosts...')\n#4 /var/www/vhosts/domain.net/public_html/wp-load.php(50): require_once('/var/www/vhosts...')\n#5 /var/www/vhosts/domain.net/public_html/wp-blog-header.php(13): require_once('/var/www/vhosts...')\n#6 /var/www/vhosts/domain.net/public_html/index.php(17): require('/var/www/vhosts...')\n#7 {main}\n thrown in /var/www/vhosts/domain.net/public_html/wp-content/object-cache.php on line 987'

According to what I found on google, Memcache not found error occurs when the extension is not installed/enabled

So... what is the correct way to install the Memcache PECL extension for PHP 7.4 with CentOS 8 and Plesk Obsidian 18?
 
The latest version of Memcache requires PHP version > 8.0:

# /opt/plesk/php/7.4/bin/pecl install memcache
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/memcache requires PHP (version >= 8.0.0), installed version is 7.4.33
No valid packages found
install failed


But you can compile the previous version with PHP 7.4 support:
Instruction is the following:

# yum install make gcc
# /opt/plesk/php/7.4/bin/pecl install memcache-4.0.5.2
# echo "extension=memcache.so" > /opt/plesk/php/7.4/etc/php.d/memcache.ini
# /usr/local/psa/bin/php_handler --reread


After that module should be loaded. Check it with:

# /opt/plesk/php/7.4/bin/php -m | grep memcache
memcache
 
The latest version of Memcache requires PHP version > 8.0:

# /opt/plesk/php/7.4/bin/pecl install memcache
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/memcache requires PHP (version >= 8.0.0), installed version is 7.4.33
No valid packages found
install failed


But you can compile the previous version with PHP 7.4 support:
Instruction is the following:

# yum install make gcc
# /opt/plesk/php/7.4/bin/pecl install memcache-4.0.5.2
# echo "extension=memcache.so" > /opt/plesk/php/7.4/etc/php.d/memcache.ini
# /usr/local/psa/bin/php_handler --reread


After that module should be loaded. Check it with:

# /opt/plesk/php/7.4/bin/php -m | grep memcache
memcache
after I run `/Applications/MAMP/bin/php/php7.4.3/bin/pecl install memcache-4.0.5.2` have error: `checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located`
 
@duyvipaz20 Have you seen that Plesk supports PECL installs directly through the GUI?
View attachment 24080
Unfortunately, I don't have GUI to manage PECL packages, I using MAMP PRO for macOS and it have PECL. I run command with like seem: `/Applications/MAMP/bin/php/php5.6.40/bin/pecl install memcache-3.0.8 --with-zlib-dir=/opt/homebrew/Cellar/zlib/1.3/include/zlib.h`

In that, `--with-zlib-dir=/opt/homebrew/Cellar/zlib/1.3/include/zlib.h` is my path root. I use brew to install zlib. after, i run command `brew info zlib` following:
1692766088646.png

And I still get the error above:
1692766168668.png
 
I see. Well, then I think it will be best to ask the question in an Apple-related forum. The experts here are using Plesk to manage their servers. Unless someone on here is a seasoned Mac user, too, you won't find a solution here.
 
Back
Top