Install xdebug on El Capitan with homebrew

Dumb question, I think, but I have PHP 5.6.14 running on El Capitan.

I installed xdebug with

brew install php56-xdebug 

But not mentioned xdebug in phpinfo

phpinfo shows:

 Configuration File (php.ini) Path: /etc 

When I run brew install php56-xdebug again, I get

 homebrew/php/php56-xdebug-2.3.3 already installed 

So, I assume that brew installed xdebug on a path (where?), Which is for a different version of PHP that I don't actually run.

Can someone help me understand what brew did and how can I customize the version of PHP that I run to enable xdebug.

+5
source share
2 answers

OK, so I fixed it. Any comments are welcome if I did it right.

1) Found where php installation brew uses

 brew info php56 

It is reported:

To enable PHP in Apache, add the following to httpd.conf and restart Apache:

LoadModule php5_module / usr / local / opt / php56 / libexec / apache2 / libphp5.so

Update php version downloaded by apache:

 sudo nano /etc/apache2/httpd.conf 

Replaced by

 LoadModule php5_module libexec/apache2/libphp5.so 

with

 LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so 
+2
source

For those using a different version of php type in terminal

-> brew search xdebug

and select your version.

after installing your version of xdebug, you must activate it by placing the installed extension path in the php.ini file.

type phpinfo () and find " Loaded configuration file ".

Open the file shown for the "Loaded configuration file" (mine is /etc/php.ini ) and paste the extension path anywhere.

for me, the installed xdebug extension path is " /usr/local/Cellar/php56-xdebug/2.5.1/xdebug.so "

so I inserted { zend_extension = "/usr/local/Cellar/php56-xdebug/2.5.1/xdebug.so "}.

restart the apache server and check phpinfo () on xdebug , that's all.

+2
source

Source: https://habr.com/ru/post/1236474/


All Articles