Failed loading /opcache.so - after DA update

nss

New member
Joined
Nov 27, 2019
Messages
9
Last night DA was updated automatically to 1.595 along with other updates. Since then, I'm getting an error when a PHP script is loaded through a cronjob:
Failed loading /opcache.so: /opcache.so: cannot open shared object file: No such file or directory

I tried updating Custombuild, and also installing opcache through custombuild again, but no luck. Any suggestions would be highly appreciated :)
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
670
Location
Murfreesboro
did you try
Code:
cd /usr/local/directadmin/custombuild
./build clean
./build update
./build opcache
./build php
./build rewrite_confs
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,530
Location
LT, EU
Did you configure opcache yourself? Please try reinstalling PHP using CustomBuild.
 

nss

New member
Joined
Nov 27, 2019
Messages
9
Thanks both!

I had ran ./build all d, but now ran all the commands listed by bdacus01. Issue remains.

When running ./build opcache it does give the following error:
Code:
./build: line 10710: /usr/local/php72/bin/php-config: No such file or directory
opCache is now installed for PHP 7.2.
That doesn't seem right :rolleyes:
 

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
670
Location
Murfreesboro
when is the last time you ran

Code:
yum update
assuming centos

what is
Code:
whereis php72
and
Code:
php -v
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,530
Location
LT, EU
Thanks both!

I had ran ./build all d, but now ran all the commands listed by bdacus01. Issue remains.

When running ./build opcache it does give the following error:
Code:
./build: line 10710: /usr/local/php72/bin/php-config: No such file or directory
opCache is now installed for PHP 7.2.
That doesn't seem right :rolleyes:
Do you have any custom/*/conifgure.php* files?
 

nss

New member
Joined
Nov 27, 2019
Messages
9
when is the last time you ran

Code:
yum update
assuming centos
Centos indeed. Running it automatically. Just double checked, and it said No packages marked for update.
what is
Code:
whereis php72
php72: /usr/local/php72
and
Code:
php -v
Failed loading /opcache.so: /opcache.so: cannot open shared object file: No such file or directory
PHP 7.2.25 (cli) (built: Dec 9 2019 20:23:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


Do you have any custom/*/conifgure.php* files?
Not sure if I do. Where can I check this?
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,514
If you have custom config files they would be at this path: /usr/local/directadmin/custombuild/custom/

You could also run the following command to show if you have custom/*/conifgure.php* files:

Code:
/usr/local/directadmin/custombuild/build used_configs
 

nss

New member
Joined
Nov 27, 2019
Messages
9
If you have custom config files they would be at this path: /usr/local/directadmin/custombuild/custom/
One directory ap2, with one file configure.php72 and the following content:
Code:
#!/bin/sh
./configure \
        --with-apxs2 \
        --with-config-file-scan-dir=/usr/local/lib/php.conf.d \
        --with-curl \
        --with-gd \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-libxml-dir=/usr/local/lib \
        --with-kerberos \
        --with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
        --with-mhash \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
        --with-mysqli=mysqlnd \
        --with-pcre-regex=/usr/local \
        --with-pdo-mysql=mysqlnd \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-sodium=/usr/local \
        --with-xsl \
        --with-zlib \
        --enable-zip \
        --with-iconv=/usr/local \
        --enable-bcmath \
        --enable-calendar \
        --enable-ftp \
        --enable-sockets \
        --enable-soap \
        --enable-mbstring \
        --with-icu-dir=/usr/local/icu \
        --enable-intl
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,514
You have the following line wich I think would prevent PHP recompiling:

Code:
--with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
You need to add \ after --with-openssl and --with-imap=/usr/local/imap-2007f , or better put it like this:

Code:
--with-openssl \
--with-imap=/usr/local/imap-2007f \
--with-imap-ssl \
However I am not sure if your custom file is used, so it would be good to see output of this command?:

Code:
/usr/local/directadmin/custombuild/build used_configs
 

nss

New member
Joined
Nov 27, 2019
Messages
9
Thanks!
However I am not sure if your custom file is used, so it would be good to see output of this command?:

Code:
/usr/local/directadmin/custombuild/build used_configs
Output of that command is:
Code:
Apache configuration file: /usr/local/directadmin/custombuild/configure/ap2/configure.apache
PHP (default) php.ini file: /usr/local/php72/lib/php.ini
PHP (default) configuration file: /usr/local/directadmin/custombuild/custom/ap2/configure.php72
PureFTPD configuration file: /usr/local/directadmin/custombuild/configure/pureftpd/configure.pureftpd
Exim Makefile: https://files6.directadmin.com/services/custombuild/Makefile
Dovecot configuration file: /usr/local/directadmin/custombuild/configure/dovecot/configure.dovecot
phpMyAdmin configuration file:
So it seems to be used.

You have the following line wich I think would prevent PHP recompiling:

Code:
--with-openssl --with-imap=/usr/local/imap-2007f --with-imap-ssl \
You need to add \ after --with-openssl and --with-imap=/usr/local/imap-2007f , or better put it like this:

Code:
--with-openssl \
--with-imap=/usr/local/imap-2007f \
--with-imap-ssl \
When I change this in the file, I should re-run ./build php (along with the other commands) again?

Since your suggested changes to that code include imap-ssl references I guess the custom file may have been created when I compiled IMAP into PHP, by following the instructions on this link https://help.directadmin.com/item.php?id=341. However, that was some time ago, at least 6mo ago.
 

nss

New member
Joined
Nov 27, 2019
Messages
9
No luck unfortunately! Same error Failed loading /opcache.so: /opcache.so: cannot open shared object file: No such file or directory.
Note that I'm not experiencing any critical issues, webserver seems to be running fine, it's just the cronjob that outputs this error continuously (it's running every minute).
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,514
Sorry it did not solve it, but the errors you corrected was important to correct. Anyway, it could also be somewhat related to this change: https://forum.directadmin.com/threads/php-configure-php-configure-phpxx-files.59687/ - some quotes from that thread wich might be relevant:

@smtalk: Another change: mod_php will use /usr/local/phpXX folder, old php.ini, php.conf.d will be symlinked to it for backwards compatibility, so, when switching the modes - configs won't be lost, if the version matches.
@smtalk (reply #12): Path in custom config is not replaced, so, I’d suggest adding default one there
@Driesp (reply #13): I had to add --prefix=/usr/local/php72 and --program-suffix=72 to my custom config to get it working.
I copied over configure/ap2/configure.php72 to custom/ap2/configure.php72, (like I always did)
but I had to copy over configure/php/configure.php72 to custom/php/configure.php72 and edit the file from there on.
So I would suggest you try to add two new lines right after before the line --with-apxs2 \ in the file /usr/local/directadmin/custombuild/custom/ap2/configure.php72:

Code:
--prefix=/usr/local/php72 \
--program-suffix=72 \
Then do this:
Code:
./build update
./build php n
./build opcache
./build rewrite_confs
If it still does not work, try to temporary delete the custom directory (or just rename it), and then recompile php and opcache again. If it then still does not work, it would not be related to the custom configure.php72

Edit: I said to add the new lines right after --with-apxs2 \, but it would look better to add them before that line. I just wrote the opposite of what I was thinking.
 
Last edited:

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,530
Location
LT, EU
Alternatively, try:
Code:
rm -f /usr/local/directadmin/custombuild/custom/ap2/configure.php72
Then run php-imap installation script again :)
 

nss

New member
Joined
Nov 27, 2019
Messages
9
Great, thank you (y), issue solved! As per @ditto suggestion, I added the two lines --prefix=/usr/local/php72 \ --program-suffix=72 \ to the custom config file. I added them after --with-apxs2 \ , and that works. But just in case - I will place the line before later, and recompile.

Thank you all for the help!!
 
Top