Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache Unable to load PHP OPCache extension #5482

Closed
user655362020 opened this issue Jul 6, 2020 · 5 comments
Closed

Apache Unable to load PHP OPCache extension #5482

user655362020 opened this issue Jul 6, 2020 · 5 comments

Comments

@user655362020
Copy link

user655362020 commented Jul 6, 2020

Problem description

Apache unable to load PHP OPCache extension. Verified using phpinfo(). When running phpinfo() in terminal I get Opcode Caching => Up and Running

Relevant apache error_log
PHP Warning: Failed loading Zend extension 'opcache.so' (tried: /data/data/com.termux/files/usr/lib/php/opcache.so (dlopen failed: cannot locate symbol "PHP_MD5Update" referenced by "/data/data/com.termux/files/usr/lib/php/opcache.so"...), /data/data/com.termux/files/usr/lib/php/opcache.so.so (dlopen failed: library "/data/data/com.termux/files/usr/lib/php/opcache.so.so" not found)) in Unknown on line 0
Steps to reproduce

Load php module in apache
Enable OPCache in php by editing php.ini and adding line zend_extension = opcache.so

Additional information

Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://termux.org/packages/ stable main
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
Updatable packages:
All packages up to date
Android version:
7.1.1
Kernel build information:
Linux localhost 3.10.49-12378949 #1 SMP PREEMPT Mon Feb 19 17:29:10 KST 2018 armv7l Android
Device manufacturer:
samsung
Device model:
SM-T355Y
@user655362020 user655362020 changed the title Unable to load PHP OPCache extension Apache Unable to load PHP OPCache extension Jul 6, 2020
@Cvar1984
Copy link

Problem description

Apache unable to load PHP OPCache extension. Verified using phpinfo(). When running phpinfo() in terminal I get Opcode Caching => Up and Running

Relevant apache error_log
PHP Warning: Failed loading Zend extension 'opcache.so' (tried: /data/data/com.termux/files/usr/lib/php/opcache.so (dlopen failed: cannot locate symbol "PHP_MD5Update" referenced by "/data/data/com.termux/files/usr/lib/php/opcache.so"...), /data/data/com.termux/files/usr/lib/php/opcache.so.so (dlopen failed: library "/data/data/com.termux/files/usr/lib/php/opcache.so.so" not found)) in Unknown on line 0
Steps to reproduce

Load php module in apache
Enable OPCache in php by editing php.ini and adding line zend_extension = opcache.so

Additional information

Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://termux.org/packages/ stable main
# science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable
# game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
Updatable packages:
All packages up to date
Android version:
7.1.1
Kernel build information:
Linux localhost 3.10.49-12378949 #1 SMP PREEMPT Mon Feb 19 17:29:10 KST 2018 armv7l Android
Device manufacturer:
samsung
Device model:
SM-T355Y

Are you sure have installed opcache.so?
ls $(php-config --extension-dir)

@user655362020
Copy link
Author

user655362020 commented Jul 12, 2020

Output of ls $(php-config --extension-dir)
opcache.so

@Grimler91
Copy link
Member

dlopen failed: library "/data/data/com.termux/files/usr/lib/php/opcache.so.so" not found

It seems to be looking for opache.so.so now, maybe your php.ini should contain

zend_extension = opcache

instead of

zend_extension = opcache.so

?

@Cvar1984
Copy link

dlopen failed: library "/data/data/com.termux/files/usr/lib/php/opcache.so.so" not found

It seems to be looking for opache.so.so now, maybe your php.ini should contain

zend_extension = opcache

instead of

zend_extension = opcache.so

?

Php finding libs with ".so" and without ".so", i think that is optional.
The problem goes here

PHP Warning: Failed loading Zend extension 'opcache.so' (tried: /data/data/com.termux/files/usr/lib/php/opcache.so (dlopen failed: cannot locate symbol "PHP_MD5Update" referenced by "/data/data/com.termux/files/usr/lib/php/opcache.so"...),

@Grimler91
Copy link
Member

Grimler91 commented Jul 21, 2020

@Cvar1984 you are right, thanks.

So this is essentially the same issue as #2479 so I'll close this in favour of that one so that we are tracking this in a single issue. One workaround is to export LD_PRELOAD=$PREFIX/libexec/apache2/library-with-PHP_MD5Update.so before starting httpd.

I am using a termux-services script for httpd containing

#!/data/data/com.termux/files/usr/bin/sh
export LD_PRELOAD=$PREFIX/libexec/apache2/mod_proxy.so
exec httpd -f $HOME/apache2/httpd.conf -DNO_DETACH 2>&1

to workaround a similar issue.

@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants