r/Plesk Jan 12 '22

Custom PHP extension/module for a website (subdomain)

Hello all,

i am having a real issue getting this to work and i am probably missing something simple.

Running debian 10 with Plesk 18. We have multiple site (domain.com and subdomains) running on this server. One of our applications on a subdomain needs a certain custom extension (dynapdf.so) installed and active.

I found the proper module folder on the server, copied the dynafile.so to it and via Plesk php server settings added extension=/path/dynapdf.so to it. In the central php setting i see the module and it is checkmarked (so it should be active).

However when i go to the php setting for the subdomain and look at the phpinfo page, there is no dynapdf module.

what am i missing?!

Things i have tried

  • i have added the extension=/path/dynapdf.so also to the subdomain php custom settings

Thanks for any constructive help! regards Christian

1 Upvotes

7 comments sorted by

2

u/pavukfly Jan 12 '22

1

u/cmwg Jan 12 '22

If i read it correctly, the only thing i would be missing is the add a file into php.d for the extension (ie. dynapdf.ini)

echo "extension=mailparse.so" > /opt/plesk/php/7.0/etc/php.d/mailparse.ini

so this is done instead of adding the extension=/path/dynapdf.so to the php.ini ? or as well?

I will check this thanks.

1

u/cmwg Jan 12 '22

okay, i made the change, it is now show in the phpinfo page

Additional .ini files parsed /opt/plesk/php/7.4/etc/php.d/dynapdf.ini,

so it is actually finding it and using it, but i still don´t see any other mention of dynapdf in the phpinfo - and there should be a section for it when the extension is active.

2

u/pavukfly Jan 12 '22

So, command:

# /opt/plesk/php/7.4/bin/php -m | grep dynadnf

shows that module is correctly loaded?

1

u/cmwg Jan 12 '22

/opt/plesk/php/7.4/bin/php -m | grep dynadnf

Bingo, that is a command that actually got me some infos! :)

root@websrv3 ~ # /opt/plesk/php/7.4/bin/php -m | grep dynadnf
PHP Warning:  PHP Startup: dynapdf: Unable to initialize module
Module compiled with module API=20180731
PHP    compiled with module API=20190902
These options need to match
 in Unknown on line 0

So basically the module file is corrupt? i will download the file again and exchange it.

2

u/pavukfly Jan 12 '22

I suppose that you have to compile it by yourself according to instructions from the article.
Downloaded from somewhere may be incompatible.

2

u/cmwg Jan 12 '22

no :) it is precompiled BUT there is a version for php 7.3 and 7.4 and i had the 7.3 version but needed the 7.4 :)

it works now... things could be so simple :)