All installed PHP modules configuration files are available under /etc/php/PHP_VERSION/mods-available directory. You can see the number of files with extension .ini. You must have installed php specific php modules, you need to enable it before further proceed. The php-common package provides followings commands to manage PHP modules.
- phpenmod – Used to enable modules in PHP
- phpdismod – Used to disable modules in PHP
- phpquery – Used to view status of modules of PHP
There are 3 types of SAPI (Server API) available – CLI, FPM, Apache2 being the most commonly used. You can define SAPI using -s
switch to enable/disable module for that only.
Enable PHP Modules
Use phpenmod command followed by module name to enable specific PHP module on your system. In below example, the first command is an example and the second command will enable mbstring module for all installed PHP versions and all SAPI.
### Syntax
phpenmod MODULE_NAME
### Enable mbstring php module
phpenmod mbstring
You can also define the PHP version using -v
switch to enable specific modules. Using this you will enable module for all SAPI.
### Syntax
phpenmod -v <PHP VERSION> <MODULE NAME>
### Enable module for specific php version
phpenmod -v 5.6 mbstring
phpenmod -v 7.4 mbstring
Use -s
switch to define the SAPI to enable specific modules for specific SAPI for all PHP versions.
### Syntax
phpenmod -s <SAPI> <MODULE NAME>
### Enable module for specific SAPI
phpenmod -s cli mbstring
phpenmod -s fpm mbstring
phpenmod -s apache2 mbstring
You can also define both the PHP version and SAPI for the more specific update.
Disable PHP Modules
You can also disable any un-necessary PHP modules from your system using phpdismod command. For example, disable mbstring module for ALL PHP versions and all SAPI.
phpdismod mbstring
To disable any module for specific PHP version use command like below.
phpdismod -v 7.4 mbstring
To disable any module for specific SAPI on all PHP versions, use command like below.
phpdismod -s apache2 mbstring
Thank you for reading this article.
Was this helpful?
2 / 1
Muchas gracias.
Thanks for sharing such a nice post, post is pleasant.
Excellent quality writing, it is rare to see a nice
blog like this one nowadays.
Thanks designed for sharing such a nice idea, post is pleasant, thats why I tried it,such a perfect approach.
Thanks designed for sharing such a nice idea, post is pleasant, thats why I tried it,such a perfect approach.
Information written in such a perfect approach.
I truly appreciate your efforts and I am waiting for your further write ups thanks. Where information written in such a perfect approach.
I truly appreciate your efforts.
I truly appreciate your efforts and I am waiting for your further write ups thanks.
Thanks for sharing your thoughts.
Thank you for informative website.
Where information written in such a perfect approach.
Thank you for informative website.
So good
Like so much!
awosunoso
hello there and thank you for your info – I’ve certainly picked up something new from right here.
I did however expertise several technical issues using this site, since
I experienced to reload the website lots of times previous to I could get it to
load correctly. I had been wondering if your web host is OK?
Not that I’m complaining, but sluggish loading instances times
will often affect your placement in google and can damage your quality score if advertising and
marketing with Adwords. Well I’m adding this
RSS to my e-mail and can look out for much more of
your respective interesting content. Ensure that
you update this again soon.
You’ve made some good points there. I looked on the net for more information about the issue and
found most people will go along with your views on this site.
Hi my friend! I want to say that this post is awesome, nice written and come with almost all important infos.
I would like to see more posts like this .
Excellent way of describing, and good post to obtain facts regarding my presentation focus, which i am going to convey in academy.
I really like all the points you’ve made.
There’s definitely a lot to know about this subject.
After study just a few of the weblog posts on your web site now, and I really like your way of blogging. I bookmarked it to my bookmark website list and will probably be checking again soon.
I recommended this website
Good one!
Good info. Lucky me I reach on your website by accident, I bookmarked it.
A big thank you for your blog.Really thank you! Really Cool.
Rattling superb information can be found on weblog.
Fantastic website. A lot of useful information here.
I’m sending it to a few pals ans additionally sharing in delicious.
And certainly, thanks to your sweat!
Wow! Thank you! I permanently needed to write on my site something like that. Can I include a fragment of your post to my site?