[英]Enable PHP extension for Apache instead CLI
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
. 我正在为Vagrant设置构建bootstrap.sh文件,并且我需要一种简单的方法(如果可能的话,可以执行bash命令)来启用PHP的一些扩展,但是当我运行
phpenmod
它会启用/etc/php/7.x/cli/php.ini
的扩展/etc/php/7.x/cli/php.ini
但我想在/etc/php/7.x/apache2/php.ini
启用。
What should I do? 我该怎么办?
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. 您可以使用
-s sapi_name
选择启用扩展的SAPI,因此phpenmod -s apache2 <extname>
应该这样做。
Although, the default should be ALL
, so I don't see why it hasn't worked for you so far without this. 虽然,默认值应该是
ALL
,所以我不明白为什么没有这个,它到目前为止对您不起作用。 Maybe you forgot to restart Apache or PHP-FPM before checking if the extension is enabled? 也许您忘记检查扩展是否启用之前忘记重新启动Apache或PHP-FPM? Double-check.
再检查一遍。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.