Brew install php53-xdebug // if you installed php53 instead of php54. Enabling XDebug I had to add the extension to my php.ini file: 1. Zendextension = '/usr/local. Since Brew is no longer working, you can use pecl to install the debugger. It's not as good as brew, you may run into dependency problems but it works. Install php with brew, whatever version you want, then use pecl. Brew install php pecl install xdebug.
Recently there have been a lot of changes to Homebrew in that there have been a number of packages renamed and improved. One of the packages that have been affected it PHP.
Specifically renaming the php71
to php@7.1
, this has caused some confusion amongst the community on how to install PHP on Mac OSX and to enable xdebug
.
In this post we will walk through the process of cleaning up a current installation of PHP on Mac OSX using Homebrew and enabling xdebug
If you have previously installed PHP on your Mac OSX using Homebrew you may want to take this opportunity to clean up your installation and reconfigure your machine with the latest packages.
Clean up old installs of PHP
Brew Xdebug Plus
We will use HomeBrew to install PHP 7.2 using the new Taps available. We will go ahead and uninstall all versions of PHP to ensure we only will have PHP installed via Homebrew.
First lets examine what PHP packages have been installed
We can now uninstall any packages that have been installed
Ensure we remove any old casks in Homebrew
Clean up all the launch agents to ensure there is no confusion later on.
We can now ensure Homebrew is cleaned up and updated
Brew Xdebug
Check to see if there are any daemons running. If there are then reboot
Install PHP using Homebrew
By default this will install PHP 7.2.x (or whatever the latest edition of PHP is when you install it)
You will now be able to write and run applications using PHP. However, if you would like to be able to debug your PHP applications there are some additional steps you need to complete to install xdebug
.
What is xdebug ?
Xdebug is an extension for PHP to assist with debugging and development. It contains a single step debugger to use with IDEs; it upgrades PHP’s var_dump()
function; it adds stack traces for Notices, Warnings, Errors and Exceptions; it features functionality for recording every function call and variable assignment to disk; it contains a profiler; and it provides code coverage functionality for use with PHPUnit.
Ppt to video converter for mac. Prior to moving the PHP taps in Homebrew it used to be possible to install xdebug and PHP7.2 at the same time using brew install php72-xdebug
, sadly this is not the case, and from what I understand this won’t be happening anytime soon.
PECL (PHP Extension Community Library) is now the source of xdebug and all future updates will available via PECL
How to install xdebug on Mac OSX
Installing xdebug via PECL is fairly straight forward, because if you have PHP7.2 installed you should be able to update your channel list first
This will check whether you already have xdebug
installed
If xdebug is not install you can simply install it using
if you want to upgrade xdebug to the latest version simply
Configure PHP to use xdebug
We need to add the following line to .
To find out where your php.ini file is
Which should return something similar too:
Configure PHP.ini
You can open the file using
The search for the
Brew Xdebug Coffee
Nintendo online shop. Then change it too
The additionally update the following
Brew Xdebug Php 7.4
Configure PHPStorm
We predominantly use PHPStorm – Lightning-smart PHP IDE as our default PHP Development editor.
So it is worhtwhile ensuring you have enabled xdebug in PHP storm as your debugger – Xdebug Installation Guide
Brew Install Xdebug Php 71
Summary
You should now have a complete PHP Development Environment configured on your Macbook.
Brew Php Xdebug
- Book Review: Building Event-Driven Microservices - April 23, 2021
- Implementing logging with Serilog - April 17, 2021
- Getting started with .net core microservices with dapr - April 11, 2021
Comments are closed.