Search code examples
servercentos6plesk

CentOS 6.5 - Plesk Onyx 17.0.17 - PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so'


I'm receiving the following error when checking the PHP version on our VPS Server running CentOS 6.5 (Final) with Plesk Onyx 17.0.17:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.

I've also run the following yum info php command which gives me:

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.bytemark.co.uk
 * epel: mirror.bytemark.co.uk
 * extras: mirrors.coreix.net
 * updates: mirrors.coreix.net
Installed Packages
Name        : php
Arch        : x86_64
Version     : 5.3.3
Release     : 48.el6_8
Size        : 3.5 M
Repo        : installed
From repo   : updates
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to make
            : it easy for developers to write dynamically generated webpages.
            : PHP also offers built-in database integration for several
            : commercial and non-commercial database management systems, so
            : writing a database-enabled webpage with PHP is fairly simple. The
            : most common use of PHP coding is probably as a replacement for CGI
            : scripts.
            : 
            : The php package contains the module which adds support for the PHP
            : language to Apache HTTP Server.

We're currently setting up a staging site to run Magento 2 and the above error is causing issues with trying to reindex any of the Magento Index Management services and installing theme/extensions.

I'm not sure what extra information would be of use so do let me know of any commands to run to generate some more useful information.

I am new to server type work so please do bear with me and go into as much detail as you can.


Solution

  • This error means that somewhere in PHP's configs in /etc/php.d/ defined loading of APC extension by string like extension = apc.so

    it may be file: /etc/php.d/apc.ini

    But file apc.so doesn't exists in default extensions folder /usr/lib64/php/modules/

    You can:

    • disable loading of this extension

    • or check existiens of /usr/lib64/php/modules/apc.so

    • or reinstall package php-pecl-apc.x86_64

      # rpm -qf /usr/lib64/php/modules/apc.so # determines package of file
      php-pecl-apc-3.1.9-2.el6.x86_64
      
      # yum remove php-pecl-apc.x86_64
      # yum install php-pecl-apc.x86_64
      

    For executing PHP scripts in CLI with system PHP you just need to install php-cli package: yum install php-cli

    In case you still need another PHP version you can try Plesk's PHP in folder /opt/plesk/php/ (like /opt/plesk/php/5.6/bin/php)

    In case you don't see anything in /opt/plesk/php/ you can install additional PHP versions with Plesk Installer.