localhost
localhost

Reputation: 871

xdebug not running on mamp

I am trying to run xdebug on mamp and followed many tutorials but when i see it in my phpinfo() i don't find xdebug. As xdebug is already included in the mamp as i read.This is line i added in my php.ini and i also went to that location to see if xdebug.so exist or not.but still its not working. any help? i am using mamp 2.1.2

p.s I modified the php version to mine in php.ini from php5 to php5.4.10

Upvotes: 5

Views: 5334

Answers (4)

Abdullah Tahan
Abdullah Tahan

Reputation: 2129

make sure that you are listening to the correct port from php.info for me was xdebug.remote_port=9900

then in vcode

{
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9900
    },

Upvotes: 0

Agoun
Agoun

Reputation: 364

You also have to check - (you already did I see) - whether the xdebug.so file exists in the location specified in php.ini.

In my case the original line was:

zend_extension="/Applications/MAMP/bin/php/php7.1.0/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"

I finally changed it to point to the correct location and it worked:

zend_extension="/Applications/MAMP/bin/php/php7.1.0/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"

No error messages however in php_error.log. I can't figure out why certain .so files are reported as missing in the log and some others aren't, like this one.

Upvotes: 0

JoanCasas
JoanCasas

Reputation: 21

Thanks @titolancreo!!

I was about to give up for today after a couple hours and just by adding the same line in both php.ini it suddenly worked!

you can also do this in your terminal to know if it works:

php -m

You should be able to see the Xdebug module two times, one in the [PHP Modules] list and another one in the [Zend Modules] list.

Upvotes: 2

Aarranz
Aarranz

Reputation: 461

I don't know if it's too late but i'm sure that someone will need the real answer.

To solve yo online have to change php.ini in the correct path...

For php 5.4.10 there are two php.ini and I changed both and it works for me. They are in:

MAMP/conf/php5.4.10/php.ini
and
MAMP/bin/php/php5.4.10/conf/php.ini

When I changed the second one, I reload MAMP and IT WORKS!! If you want to know if it's working, open MAMP on localhost, click phpinfo and find xdebug.

Also, I have to say that I changed in httpd.conf (MAMP/conf/apache) the port 8888 to 80 (you have to change Listen:8888 to Listen:80 and local_host:8888 to local_host:80. (without _) In that case, yo only have to go to http: / / localhost to see your projects

Upvotes: 16

Related Questions