How to disable/enable a PHP module with phpdismod?

风流意气都作罢 提交于 2020-01-05 04:09:15

问题


I want to be able to turn on/off Xdebug a simple and fast way. To disable it I tried out phpdismod, but only results in a warning:

$ phpdismod xdebug
WARNING: Module xdebug ini file doesn't exist under /etc/php/7.0/mods-available
WARNING: Module xdebug ini file doesn't exist under /etc/php/7.0/mods-available

How to get a PHP module disabled/enabled with phpdismod?


Environment: Ubuntu 14.04, nginx 1.4.6, PHP 7.0 FPM.

$ ls -l /etc/php/mods-available/ | grep "xdebug"
-rw-r--r-- 1 root root 743 Jul  1 16:16 xdebug.ini
$ ls -l /etc/php/7.0/mods-available/ | grep "xdebug"
$ ls -l /etc/php/7.0/fpm/conf.d/ | grep "xdebug"
lrwxrwxrwx 1 root root 34 Feb 17 23:08 20-xdebug.ini -> /etc/php/mods-available/xdebug.ini
$ ls -l /etc/php/7.0/fpm/conf.d/ | grep "xdebug"
lrwxrwxrwx 1 root root 34 Feb 17 23:08 20-xdebug.ini -> /etc/php/mods-available/xdebug.ini
$ ls -l /etc/php/7.0/cli/conf.d/ | grep "xdebug"
lrwxrwxrwx 1 root root 34 Feb 17 23:16 20-xdebug.ini -> /etc/php/mods-available/xdebug.ini

回答1:


I'm having the same problem with the docker-lemp-stack.

In the php70/Dockerfile, the PHP module configs line puts the local xdebug.ini file into /etc/php/mods-available/xdebug.ini (which you see in your setup).

I've amended the line from ...

ADD conf/mods-available/xdebug.ini /etc/php/mods-available/xdebug.ini

to ...

ADD conf/mods-available/xdebug.ini /etc/php/7.0/mods-available/xdebug.ini

and rebuilt the docker image

I now get the right handling for the env var which controls the xdebug.

So if you move the files to the right location you should be OK.



来源:https://stackoverflow.com/questions/38148151/how-to-disable-enable-a-php-module-with-phpdismod

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!