0

I'm building a bootstrap.sh file for a Vagrant setup and I need a simple way (bash command if possible) to enable a few extensions of PHP but when I run phpenmod it enable the extension for /etc/php/7.x/cli/php.ini but I want to enable in /etc/php/7.x/apache2/php.ini.

What should I do?

3
  • 2
    just install it, and if its not a custom extension it will enable itself Commented Apr 6, 2019 at 14:03
  • tecadmin.net/enable-disable-php-modules-ubuntu Commented Apr 6, 2019 at 14:04
  • @LawrenceCherone it works! If it was an answer I would approve it. Thanks! Commented Apr 6, 2019 at 14:33

1 Answer 1

1

Take a look at the options:

$ phpenmod
WARNING: 
usage: phpenmod [ -v ALL|php_version ] [ -s ALL|sapi_name ] module_name [ module_name_2 ]

You can use -s sapi_name to choose which SAPI to enable an extension for, so phpenmod -s apache2 <extname> should do it.

Although, the default should be ALL, so I don't see why it hasn't worked for you so far without this. Maybe you forgot to restart Apache or PHP-FPM before checking if the extension is enabled? Double-check.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.