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

Support for PHP8 on Debian #145

Closed
amotl opened this issue Apr 22, 2021 · 9 comments
Closed

Support for PHP8 on Debian #145

amotl opened this issue Apr 22, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@amotl
Copy link

amotl commented Apr 22, 2021

Dear Newrelic team,

thanks a stack for conceiving PHP8 support for the PHP agent. We recently upgraded to PHP8 and now #35 comes just in time. Kudos to all people who have been involved!

Now, when the updated version 9.17.0.300 is being installed through the package repository, it still tells us:

Unknown PHP version: 8.0

and /var/log/php/error.log says:

[22-Apr-2021 18:39:00 Europe/Berlin] PHP Warning:  PHP Startup: Unable to load dynamic library 'newrelic.so' (tried: /usr/lib/php/20200930/newrelic.so (/usr/lib/php/20200930/newrelic.so: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/newrelic.so.so (/usr/lib/php/20200930/newrelic.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[22-Apr-2021 18:39:00 Europe/Berlin] PHP Warning:  Module 'newrelic' already loaded in Unknown on line 0

We tried to follow the documentation through #133 and [1] and also tried dpkg-reconfigure newrelic-php5, which also tells us:

Unknown PHP version: 8.0
Unknown PHP version: 8.0

We verified that we run the most recent version:

apt show newrelic-php5
Package: newrelic-php5
Version: 9.17.0.300

Indeed, the most recent newrelic.so apparently does not get symlinked into /usr/lib/php/20200930.

# ls -1 /usr/lib/php/*/newrelic.so
/usr/lib/php/20151012/newrelic.so
/usr/lib/php/20170718/newrelic.so
/usr/lib/php/20180731/newrelic.so
/usr/lib/php/20190902/newrelic.so

With kind regards,
Andreas.

[1] https://docs.newrelic.com/docs/agents/php-agent/installation/php-agent-installation-ubuntu-debian/

@amotl amotl added the bug Something isn't working label Apr 22, 2021
@amotl
Copy link
Author

amotl commented Apr 22, 2021

Hi again,

we have been able to resolve this by manually symlinking newrelic.so into /usr/lib/php/20200930 by invoking

ln -s /usr/lib/newrelic-php5/agent/x64/newrelic-20200930.so /usr/lib/php/20200930/newrelic.so

After bouncing the web container systemctl reload php8.0-fpm, <? phpinfo(); ?> successfully shows:

image

With kind regards,
Andreas.

@amotl
Copy link
Author

amotl commented Apr 22, 2021

Hi once more,

I wanted to share another observation, maybe this helps to investigate this issue. When running

dpkg-reconfigure newrelic-php5

it creates a symlink at /usr/lib/php/newrelic.so pointing to /usr/lib/newrelic-php5/agent/x64/newrelic-.so, which is obviously the wrong target.

With kind regards,
Andreas.

@Fahmy-Mohammed
Copy link
Contributor

Hi @amotl

Thank you for the great details! This info will be helpful in reproducing the issue.

While we're working on a reproduction, can you confirm what version of Python you are using? We've seen similar symlink issues on systems using Python 2 and it would be good to rule this out. Since PHP agent 9.10, the agent installer for Ubuntu/Debian systems now requires Python 3.

@Fahmy-Mohammed Fahmy-Mohammed added this to Triage - tag + prioritize. in PHP/C Engineering Board via automation Apr 22, 2021
@amotl
Copy link
Author

amotl commented Apr 22, 2021

Hi Fahmy,

thanks for your quick response. We are running Debian GNU/Linux 9 (stretch) and have both Python 2 and Python 3 installed.

With kind regards,
Andreas.


root@gagarin:~# hostnamectl
   Static hostname: gagarin
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 9b6e6030fd3a0a1e2fdb90d1000184dd
           Boot ID: e9a68b0d2479485c8f17c57dfa0baa03
    Virtualization: xen
  Operating System: Debian GNU/Linux 9 (stretch)
            Kernel: Linux 4.9.0-12-amd64
      Architecture: x86-64
root@gagarin:~# cat /etc/debian_version
9.13
root@gagarin:~# python -V
Python 2.7.13

root@gagarin:~# python3 -V
Python 3.5.3

@kimhemsoe
Copy link

kimhemsoe commented Apr 23, 2021

Hello

We see similar issues with debian. Python 2 not installed, using php8 from sury.org.

Symlink created the wrong place and pointing to file there does not exists

root@d1f215463953:/opt/heaps# cat /etc/debian_version
10.8

root@d1f215463953:/opt/heaps# python3 --version
Python 3.7.3

root@d1f215463953:/usr/lib/php# ls -l
total 40
drwxr-xr-x 2 root root 4096 Mar 24 11:31 20200930
drwxr-xr-x 3 root root 4096 Mar 24 11:31 8.0
lrwxrwxrwx 1 root root   45 Apr 22 09:27 newrelic.so -> /usr/lib/newrelic-php5/agent/x64/newrelic-.so

# apt show newrelic-php5
Package: newrelic-php5
Version: 9.17.0.300
Status: install ok installed

@Fahmy-Mohammed
Copy link
Contributor

Thank you @amotl and @kimhemsoe. We're still investigating the issue and hope to have an update soon.

@Fahmy-Mohammed
Copy link
Contributor

@amotl @kimhemsoe We've been able to reproduce and resolve the issue with the installer. The fix will be included in v9.17.1 of the agent and should be released this week. Thank you for your engagement and feedback!

@Fahmy-Mohammed Fahmy-Mohammed moved this from Triage - tag + prioritize. to In Progress - Issues that are actively being worked on. in PHP/C Engineering Board Apr 27, 2021
@Fahmy-Mohammed
Copy link
Contributor

PHP agent 9.17.1 containing the fixes has been released. Please let us know if this resolves the issues.

@amotl
Copy link
Author

amotl commented Apr 28, 2021

Dear Fahmy and all people involved fixing this issue,

we just installed the updated packages and can not see any flaws. In the meanwhile, we are running Debian GNU/Linux 10 (buster). Thank you very much for the quick resolution!

With kind regards,
Andreas.

@amotl amotl closed this as completed Apr 28, 2021
PHP/C Engineering Board automation moved this from In Progress - Issues that are actively being worked on. to Done Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants