Score:0

What is the correct way to enable PHP extentions, manually or via mods-available?

ng flag

I am used to enabling PHP extensions by manually adding them into my php.ini file, for example: extension=x.so. But today I learned that one PHP extension failed to load because putting the extension=x.so fails because some extensions are loaded after the php.ini is contacted.

The solution I found was to use phpenmod and create a extension.ini file within /etc/php/7.4/mods-available. This solved my problem but my question is which is the correct way? - I was always used to manually editing my php.ini file, is that not recommended anymore, I can't seem to find much information on this? When did this change come about?

djdomi avatar
za flag
the Offical way, is the second.
Erdss4 avatar
ng flag
@djdomi Can you link to any docs for this?
djdomi avatar
za flag
its the similar reason for nginx and also Apache - its the file structure of the Directories - you can see that also with `php-config` where it has been forced to used by your Distribution
Michael Hampton avatar
cz flag
@djdomi This is the Debian way, not the official way. The official way, such as it is, is to manaully edit the php.ini yourself, which is why Debian maintainers created this much easier scheme. It should be used when on Debian-based systems.
djdomi avatar
za flag
I am sorry, forgot about that ;) Using debian for now since 20+ years xD
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.