How to install two php extensions - Memcache & HTML Tidy extension

Roberto

Verified User
Joined
Apr 6, 2013
Messages
127
Location
London
Hi

I have a number of accounts on the DM server running sites with Wordpress CMS. I am using a caching plugin which has the following requirements which are not enabled/installed on my server:

Memcache extension & HTML Tidy extension

I assume they are both PHP extensions. Please can someone kindly advise me how to enable these? I can't see that as an option on CustomBuild 2.0, so think I need to manually install myself?

Regards
themadguru
 
I have just found out how to install memcache. I followed these steps on CentOS 7:-

# yum install memcached -y
# yum install autoconf -y
# pecl install memcache

Added this line to php.ini

"extension=memcache.so"

then restarted Apache.

Hope this helps others. I'll post back if I find out how to install HTML Tidy before anyone else does in case this helps others.

I have one other problem I noticed. The Wordpress plugin I am using is W3 Total Cache. In the "Compatability Test", it also states that "Opcode cache: Not installed". However, the settings on the DirectAdmin CustomBuild plugin shows this setting has active "opcache=YES". (was done on DM install and server has been rebooted many times since.). I have no idea why the plugin W3 Total cache is not picking this up as installed? Any ideas?

I did

Regards
 
Hello,

Tidy:
http://php.net/manual/en/tidy.installation.php
https://help.directadmin.com/item.php?id=252

OPcache:
You should see OPcache in phpinfo() output or in console:

Code:
php -v
PHP 5.6.25 (cli) (built: Sep  9 2016 06:10:38)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.20, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
[B]    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies[/B]

it's not installed or disabled if it's not shown.
 
Hi zEitEr

Thanks for your response.

I have successfully installed the HTML Tidy extension. Great! For anyone else running Centos 7, please be aware that I had to make use of the Webtatic EL yum repository by running the following commands:-

Code:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

(source: https://webtatic.com/packages/php56/)

I ran the php -v command, and OPCache seems to be installed and enabled; see below:-

Code:
# php -v
PHP 5.6.25 (cli) (built: Sep 12 2016 13:17:55)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.20, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Suhosin v0.9.38, Copyright (c) 2007-2015, by SektionEins GmbH

...And yet the W3 Total Cache plugin still states "Opcode cache: Not installed". I am baffled?? Could it be that I have an older version of Zend OPcache v7.0.4-dev? If so, I'm not sure how to update. I have the CustomBuild 2.0 plugin running and it seems to think everything is up-to-date ("There are no updates available").

I read on the link below that opcache not being acknowledged as installed could be a "bug in W3 Total Cache's detection script".

https://www.digitalocean.com/community/questions/regarding-w3-total-cache-settings

Regards
themadguru
 
Last edited:
I have just noticed that after executing "Build All" in CustomBuild 2.0 plugin, memcache is no longer installed. Am I right in thinking that maybe used the wrong method I mentioned in Post #2 on this thread, and rather I should have used a similar method to that used for HTML Tidy?

It seems that the "extension=memcache.so" in php.ini disappeared after a Build All, so I simply added it again. I am wondering if there is a way to keep changes to php.ini after an upgrade?
 
Last edited:
Check with
Code:
php --ini
where PHP is looking for additional .ini files, and create there a 99-custom.ini with your custom directives. It will protect your changes from being overwritten.

p.s. you don't need to run ./build all for reinstalling php. Simply run
Code:
./build php
That's sufficient.
 
Thanks for explaining. Understood.

I still have the problem with the Wordpress Plugin, W3 Total Cache, still states "Opcode cache: Not installed", even though it is.

When I run a website test on https://tools.pingdom.com, I can see the .js and .css files are not being minified. I suspect this is because OpCache is not working with W3 Total Cache as it should.

Has anyone overcome this issue?

Regards
themadguru
 
Back
Top