0

we got a new WebServer with CentOS, Plesk and php-fpm. Now we don't get the php extension running.

What we did:

  • installed latest SQL Anywhere 17 (ebf29577)
  • copied php-7.3.0_sqlanywhere_r.so to /opt/plesk/php/7.3/lib64/php/modules/
  • loading php-7.3.0_sqlanywhere_r.so via /opt/plesk/php/7.3/etc/php.d/sqlanywhere.ini
  • this leads to an error: WARNING: [pool plesk-php73-fpm.plesk-service.localdomain] child 11616 said into stderr: "NOTICE: PHP message: PHP Warning: request_startup() for sqlanywhere module failed in Unknown on line 0" (This leads to php 7.3 fpm is not loading at all)
  • next try was to switch from FPM to CGI: same error
  • module is loadable itself within shell if LD_LIBRARY_PATH was enhanced with path /opt/sqlanywhere17/lib64/
  • some tries getting the cause by strace did not help

Has anybody an idea or maybe even successfully installed php extension.

Thanks Florian

Fabian Knauf
  • 117
  • 8
  • One step forward: /opt/plesk/php/7.3/bin/php -c /opt/plesk/php/7.3/etc/php.ini -i returns a correct and complete phpinfo with extension when run as root. But as user it returns the error message. – Fabian Knauf Nov 20 '20 at 09:21
  • php -i returns the wanted result, but it is not possible to get the same result when php-fpm runs within webserver. Box Environment in phpinfo shows USER and HOME as variables only. I can't find a way to add further variables. – Fabian Knauf Nov 20 '20 at 17:33

2 Answers2

0

after a lot of tests we found a solution: in Plesk Domain php settings we had to add:

[php-fpm-pool-settings]
env[LD_LIBRARY_PATH]="/opt/sqlanywhere_v2/lib64:$LD_LIBRARY_PATH"

Now all libs are found and it works

Fabian Knauf
  • 117
  • 8
0

For me solution was, creating custom handler:

plesk bin php_handler --add -displayname "PHP SQLAnywhere 7.4" -path /opt/php-custom-handlers/7.4/php-sqlanywhere.fcgi -clipath /opt/plesk/php/7.4/bin/php -phpini /opt/plesk/php/7.4/etc/php.ini -type fastcgi

php-sqlanywhere.fcgi contents:

#!/bin/bash
LD_LIBRARY_PATH=/opt/sqlanywhere17/lib64
export LD_LIBRARY_PATH
exec /opt/plesk/php/7.4/bin/php-cgi "$@"

And finally using this handler on domain php settings and adding on additional directives:

extension=sqlanywhere.so
ropic
  • 111
  • 2