Skip to main content
Luxian's Notes

Main navigation

  • Home
User account menu
  • Log in

Breadcrumb

  1. Home

How to enable xdebug for PHP 7.0 in AMPPS 3.7

By luxian, 12 October, 2017

AMPPS is a great, but it lacks xdebug support. If you run the latest AMPPS version 3.7 on OS X you probably don't have the xdebug extension in the php-7.0/lib/extension folder.

To enable it you have to the following:

1. Select the PHP version you want to run via AMPPS GUI (in my case was PHP 7.0)

2. Make sure you use AMPPS' PHP binary inside terminal by running the following command

ls -l `which php`

The output should be something like:

/Applications/AMPPS/php/bin/php

If not try to run this:

export PATH="/Applications/AMPPS/php/bin:$PATH"

Try to run the previous command again and the path you see should be the one inside AMPPS directory.

3. Copy the phpinfo() output from localhost/cgi-bin/phpinfo.cgi

4. Download the right xdebug version you need from xdebug.org/wizard.php (you will have to paste the page text copied at step 1)

5. Untar/unzip xdebug files. - I used Zipeg, but should work  with tar command in the terminal as well

7.  Inside the folder with the xdebug files start running the command recommended by xdebug download page. First command to run is:

phpize

8. Second command requires some custom parameters to make it compatible with AMPPS (see Issues with enabling Xdebug on AMPPS)

./configure --enable-xdebug CC="gcc -arch i386" CXX="g++ -arch i386"

7.  Third command will be simple: 

make

8. Copy files to AMPPS:

cp modules/* /Applications/AMPPS/php/lib/extensions/

8. Enable xdebug inside php.ini by un-commenting this line inside the php.ini (make sure you adjust paths for different versions if needed):

Open /Applications/AMPPS/conf/php-7.0.ini and un-comment this line to look like this:

zend_extension = "{$path}/php-7.0/lib/extensions/ext/xdebug.so"

If needed, also add other xdebug settings to both files. For example I added the one recommended for PhpStorm (without the profiler and without port number since I'm using default):

[Xdebug]
xdebug.remote_enable=1

9. Restart apache using AMPPS GUI and enjoy.

 

Tags

  • os x
  • ampps
  • webdevelopment
  • Add new comment

Comments1

About text formats

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Lennart (not verified)

7 years 4 months ago

Just saying thanks

Thank you very much for this. I always have a hard time setting up xdebug, but I just followed the steps and it worked. Great!

  • Reply

Pages

  • Contact
  • My tech
  • Wishlist
RSS feed
Powered by Drupal