• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Additional PHP-handler - APC doesn't work

Philipp1

New Pleskian
Hello forum,

my situation:
I have a VPS running with Ubuntu 12.04, PHP 5.3 and Plesk 12.
For my project I need PHP 5.4 and 3 extensions (APC, mod_pagespeed, Apache Booster).
Therefore I have installed PHP 5.4.37 as a second PHP handler and registered it in Plesk according to this tutorial: http://kb.odin.com/en/118378
Then I've installed APC.

The problem: APC is only active when I select PHP 5.3 in Plesk. When I select PHP 5.4 then APC is not enabled.

My question: to be honest I do not know exactly what I did by installing PHP 5.4 as additional PHP handler. Can you tell me if I'm heading in the right direction with this? If yes, how can I get APC working?
Or should I rather upgrade PHP 5.3 to 5.4?

Any help would be highly appreciated.
 
@jorge ceballos: Probably not a dumb question at all. I installed PHP and afterwards I installed the APC extension - so the answer is probably no.
Can you maybe tell me what I need to do?
 
Hi Phillip1,

You are right, none of the additional handlers are using APC - at least in my servers -.
Tried all kind of things regarding extensions, paths, etc and none made APC work along these additional versions.
Last night came across something very interesting; seems that since PHP 5.4, APC does not work any longer.
Now there's a new module called OPcache which is natively installed and you have to compile and then activate.

I recompiled PHP 5.5.22 with --enable-opcache, along the rest of the regular expected commands:

./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php5522-cgi' '--with-config-file-path=/usr/local/php5522-cgi/etc' '--disable-debug' '--with-pic' '--enable-zip' '--disable-rpath' '--enable-fastcgi' '--enable-opcache' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php5522-cgi' '--with-png-dir=/usr/local/php5522-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php5522-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php5522-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php5522-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php5522-cgi/php.d'

Did the rest of the make, make test and make install procedures plus updating the php_handler.

After that, logged into the proper php.ini file (/usr/local/php5522-cgi/etc/php.ini) and activated opcache = 1.

And finally to make it work added: zend_extension=opcache.so

Restarted apache and finally got:

PHP 5.5.22 (cli) (built: Feb 27 2015 13:44:50)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

Just one more thing.
Changed PHP version for one the sites and it inmeditely showed opcache working but for another site it just did not show at all, still it showed the night new version 5.22.
Peeked into this site's php.ini and at the top it showed the old APC extension.
Changed it manually (I know this file is auto generated by the system) ,restarted httpd and there it is.

Hope this helps.

Regards.
 
@jorge ceballos I've installed APC 3.1.13. Although you can find different statements on the internet I think APC is compatible with PHP 5.4.x since APC 3.1.10.
See: http://pecl.php.net/package/APC/3.1.10

Yesterday I've installed PHP 5.5 + OpCache and found out that I need another extension to get OpCache running for my project: APCu. Unfortunately this completely messed up my system. It had to be restored at the end.

I've now asked my hosting company for help. Let's see what they say.
 
Back
Top