Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550676 - dev-lang/php[opcache] configures wrong path for extension
Summary: dev-lang/php[opcache] configures wrong path for extension
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 18:19 UTC by shinydoofy
Modified: 2016-07-11 20:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shinydoofy 2015-05-28 18:19:05 UTC
dev-lang/php, with the opcache USE flag set seems to use two different paths for where to put extensions.

The newly stable ebuild of version 5.6.9 (effectively) writes "/usr/lib64/php5.6/lib64/opcache.so" in the opcache.ini file unter /etc, whereas the extension is later installed into /usr/lib64. The same goes for 5.5.25 as well as far as I can see. Thus, as the two paths don't match, every now and then the apache log is riddled with unnecessary error messages.

Thus, those who would like to make use of this extensions have to change the path in the opcache.ini file and actively ignore config file changes on every php upgrade installed.

I would suggest putting it into ${PHP_DESTDIR}/lib/opcache.so instead.

Reproducible: Always

Steps to Reproduce:
1. Have php installed with the opcode USE flag set
2. Request a php script from the hosting apache httpd
Actual Results:  
/var/log/apache/error_log states:
error_log:Failed loading /usr/lib64/php5.6/lib64/opcache.so:  /usr/lib64/php5.6/lib64/opcache.so: cannot open shared object file: No such file or directory


Expected Results:  
no error message in the log file, the extension is successfully loaded and used
Comment 1 Brian Evans (RETIRED) gentoo-dev 2015-05-28 18:36:38 UTC
I've never had a problem:

akame linux # ls /usr/lib64/php5.*/lib64/
/usr/lib64/php5.5/lib64/:
opcache.so

/usr/lib64/php5.6/lib64/:
opcache.so

akame linux # eix -e php
[U] dev-lang/php
     Available versions:
     (5.4)  5.4.39 5.4.40 5.4.41
     (5.5)  5.5.22 5.5.23 5.5.24 5.5.25 5.5.25-r1
     (5.6)  (~)5.6.7 (~)5.6.8 5.6.9
       {apache2 bcmath berkdb bzip2 calendar cdb cgi cjk +cli crypt +ctype curl curlwrappers debug embed enchant exif +fileinfo +filter firebird flatfile fpm frontbase ftp gd gdbm gmp +hash +iconv imap inifile intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libmysqlclient mhash mssql mysql mysqli mysqlnd nls oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm readline recode selinux +session sharedmem +simplexml snmp soap sockets spell sqlite ssl sybase-ct systemd sysvipc threads tidy +tokenizer truetype unicode vpx wddx +xml xmlreader xmlrpc xmlwriter xpm xslt zip zlib}
     Installed versions:  5.4.41(5.4)(11:34:35 AM 05/20/2015)(berkdb bzip2 cgi cli crypt ctype curl fileinfo filter fpm gd gdbm hash iconv intl ipv6 json mysql mysqli mysqlnd nls pdo phar posix readline session simplexml soap sockets sqlite ssl tokenizer unicode xml xmlreader xmlwriter xslt zlib -apache2 -bcmath -calendar -cdb -cjk -curlwrappers -debug -embed -enchant -exif -firebird -flatfile -ftp -gmp -imap -inifile -iodbc -kerberos -ldap -ldap-sasl -libedit -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode -selinux -sharedmem -snmp -spell -sybase-ct -systemd -sysvipc -threads -tidy -truetype -wddx -xmlrpc -xpm -zip) 5.5.25(5.5)(01:03:17 PM 05/19/2015)(berkdb bzip2 cgi cli crypt ctype curl fileinfo filter fpm gd gdbm hash iconv intl ipv6 json mysql mysqli nls opcache pdo phar posix readline session simplexml soap sockets sqlite ssl tokenizer unicode xml xmlreader xmlwriter xslt zlib -apache2 -bcmath -calendar -cdb -cjk -debug -embed -enchant -exif -firebird -flatfile -frontbase -ftp -gmp -imap -inifile -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode -selinux -sharedmem -snmp -spell -sybase-ct -systemd -sysvipc -threads -tidy -truetype -vpx -wddx -xmlrpc -xpm -zip) 5.6.9(5.6)(11:07:53 AM 05/20/2015)(berkdb bzip2 cgi cli crypt ctype curl fileinfo filter fpm gd gdbm hash iconv imap intl ipv6 json mysql mysqli nls opcache pdo phar posix readline session simplexml soap sockets sqlite ssl tokenizer unicode xml xmlreader xmlrpc xmlwriter xslt zlib -apache2 -bcmath -calendar -cdb -cjk -debug -embed -enchant -exif -firebird -flatfile -frontbase -ftp -gmp -inifile -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode -selinux -sharedmem -snmp -spell -sybase-ct -systemd -sysvipc -threads -tidy -truetype -vpx -wddx -xpm -zip)
Comment 2 shinydoofy 2015-05-28 19:00:40 UTC
Huh, that's odd. There was a file collision I didn't bother looking into when upgrading from 5.5.25 to 5.6 about opcache.so, so I ended up simply removing the 5.5 installation and reinstalling 5.6 from scratch as the only version.

# ls -lh /usr/lib64/opcache.so 
-rwxr-xr-x 1 root root 153K May 28 19:51 /usr/lib64/opcache.so
# ls -lh /usr/lib64/php5.6/lib/
total 4.0K
drwxr-xr-x 2 root root 4.0K May 28 19:51 build

As one can see, the files have been freshly created by the 5.6.9 ebuild for my server machine. The way I read the ebuild file, it uses dolib.so to install a library which is successful by itself – just not into the right directory.

Here's the output of emerge -pv php, maybe some other use flag negatively influences what happens for me:
[ebuild   R    ] dev-lang/php-5.6.9:5.6::gentoo  USE="apache2 bcmath berkdb bzip2 crypt ctype curl exif fileinfo filter ftp gd gdbm gmp hash iconv imap ipv6 json mysql mysqli nls opcache pdo phar posix readline session simplexml soap ssl tokenizer truetype unicode xml xmlreader zip zlib -calendar -cdb -cgi -cjk -cli -debug -embed -enchant (-firebird) -flatfile -fpm (-frontbase) -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode (-selinux) -sharedmem -snmp -sockets -spell -sqlite (-sybase-ct) -systemd -sysvipc -threads -tidy -vpx -wddx -xmlrpc -xmlwriter -xpm -xslt" 0 KiB
Comment 3 Dmitry Rassokhin 2015-06-03 13:10:26 UTC
Try to add some use flag, that "split" php instance. For example - "cli" or "fpm"
Comment 4 shinydoofy 2015-06-21 14:54:40 UTC
I emerged php-5.6.10 with USE="cli apache" and it did indeed fix the issue. Thank you for the hint!

However, I don't need the cli part. I only need php for some standard PHP applications on apache. I find having the cli installation around unnecessary.

Is there a way to have the extension config set up correctly and only have the apache2 SAPI? I can't even fully figure out why this works correctly for having multiple SAPIs.
Comment 5 Michael Orlitzky gentoo-dev 2016-07-11 14:40:16 UTC
Finally tracked this down!

commit f44a1236fac5a45cb21d26e5e31583cc5bdd1ed8
Author: Michael Orlitzky <mjo@gentoo.org>
Date:   Mon Jul 11 10:37:48 2016 -0400

    dev-lang/php: new revisions fixing opcache installation location logic.

    We install the opcache extension with a call to dolib.so, which
    requires an earlier call to "into" to set its installation
    location. If the user enables any SAPIs other than apache2, that
    happens incidentally. However, if only the apache2 SAPI is enabled,
    the installation location is never set, ultimately causing the
    extension to fail to load. This is fixed by adding a call to "into"
    directly before the dolib.so call.

    Two calls to use_if_iuse were also replaced with the simpler "use".

    Gentoo-Bug: 550676

    Package-Manager: portage-2.2.28
Comment 6 shinydoofy 2016-07-11 20:19:38 UTC
Works, thank you very much!