Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Andy Grunwald:
Migrate your local PHP 7.2 setup to Homebrew v1.5.*
May 01, 2018 @ 15:25:51

The OS X users out there are no doubt familiar with the Homebrew package management system that makes it easier to install and update software on your system. This includes PHP and several other related pieces of software. In this post to his site Andy Grunwald shows you how to use Homebrew to migrate your local PHP setup up to PHP 7.2.

Last week, Hans Puac, a colleague of mine, wrote a small guide into our internal company chat on how to migrate your local PHP environment on macOS to the new Homebrew version 1.5.*. The guide helped a lot of other engineers inside trivago. I thought it might help more people from the internet. I asked Hans if I am allowed to share it, and he approved. So kudos belongs to him. Here we go:

With Homebrew 1.5.0 the tap homebrew/php got deprecated. They migrated it to homebrew/core, but this is changing the installation process completely.

He then walks through the steps (complete with the commands required) to make the update happen:

  1. Cleanup (the currently installed PHP packages)
  2. Update [Homebrew]
  3. Install PHP (7.2)
  4. Verify the installation
  5. Install extensions
  6. Cleanup

He also includes a few tips to help you troubleshoot some of the common problems including wrong versions of PHP, wrong php.ini being used and a "module already loaded" issue.

tagged: php72 homebrew osx migrate tutorial process package

Link: https://andygrunwald.com/blog/migrate-your-local-php-7.2-setup-to-homebrew-v1.5./

Freek Van der Herten:
How to upgrade from PHP 7.1 to 7.2 on MacOS using Homebrew
Feb 02, 2018 @ 16:55:29

Those on OSX using PHP via Homebrew may be wondering how they can upgrade their systems to the latest version of the language, PHP 7.2. Fortunately, as Freek Van der Herten shows in this new post the upgrade process is just a few quick commands away.

PHP 7.2 was released almost two months ago. I decided to wait a bit until a stable version of Xdebug with PHP 7.2 compatibility was available. And that happened yesterday with the release of Xdebug 2.6.

To make the switch over to PHP 7.2 from 7.1 (or really any other PHP version) it's a simple matter of unlinking the current version and installing PHP 7.2 with the matching Xdebug package. He also includes the commands for installing the packages for Imagick and Redis handling.

tagged: php71 php72 upgrade homebrew install unlink command tutorial

Link: https://murze.be/how-to-upgrade-from-php-71-to-72-on-macos-using-homebrew

Michael Dyrynda:
Switching PHP versions with Laravel Valet
Jan 24, 2017 @ 15:57:40

On his site Michael Dyrynda shows you how to switch PHP versions in Laravel Valet away from the current default of PHP 7.1 (should the need arise).

At the time of writing, Laravel Valet ships with PHP 7.1 but if you're like me, you have some legacy projects around the place that haven't quite lifted their dependencies to PHP 7 just yet.

A lot of folks might have previously used a VirtualBox Virtual Machine, or more recently considered Docker but a lot of the time and especially when dealing with simpler situations, Valet may be all that you need.

Luckily, the combination of Valet and brew on macOS makes switching PHP versions really easy.

With the help of the Homebrew tool it's as easy as telling it to install the PHP version you require and create the link to this needed version. He's included two screencasts in the post to show the process and commands you'll need to accomplish it.

tagged: laravel valet language version switch homebrew link tutorial

Link: https://dyrynda.com.au/blog/switching-php-versions-with-laravel-valet

Three Devs & A Maybe:
Checking in with Lew and hearing about Blue n' Vue
Jan 10, 2017 @ 16:48:14

The Three Devs & A Maybe podcast, with hosts Michael Budd, Fraser Hart, Lewis Cains and Edd Mann, has posted their latest episode today - Checking in with Lew and hearing about Blue n' Vue:

In this weeks episode we have a long overdue catch-up with Lew. We start off by discussing what he has been up to, and a certain four-legged addition to his family. From here we move on to chat about working on a product vs. working in an agency setting, picking your battles when refactoring and not being scared to make mistakes. Finally, we highlight how Edd has recently used personal Homebrew taps, using Android simulators for testing and Lew’s experience with Vue.js.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for updates when new shows are released.

tagged: threedevsandamaybe podcast lew vuejs homebrew

Link: http://threedevsandamaybe.com/checking-in-with-lew-and-hearing-about-blue-n-vue/

Eric Barnes:
How to set up your Mac for local PHP Development
Aug 05, 2015 @ 15:48:14

Eric Barnes has posted a guide to helping you set up (as he sees it) a good PHP development environment on your Mac that includes Homebrew for package management, Composer, Vagrant and the Laravel Homestead VM for project hosting.

This past weekend I decided it was finally time to wipe my Macbook’s hard drive and start fresh. I have used it daily for several years now and still had artifacts from when I used Mamp. Since then Vagrant has turned to my local server of choice and one of the reasons is how clean you can keep your machine by utilizing it.

After finishing the new Mac OS X install it felt like a new beginning. So clean, so minimal. [...] This go around I wanted to keep it as minimal as possible and only install things I know I need and use. This tutorial covers how I set up my Mac for local PHP Development.

His list of software includes the previously mentioned four as well as the ZSH shell replacing the default bash and, obviously, PHP itself installed via Homebrew.

tagged: osx mac local development homestead composer zsh vagrant homebrew

Link: http://ericlbarnes.com/set-mac-local-php-development/

Rob Allen:
Setting up PHP & MySQL on OS X Yosemite
Oct 20, 2014 @ 14:43:36

Rob Allen has posted a quick guide to help you get PHP and MySQL set up on Yosemite, the latest version of Apple's OSX operating system (just released last week).

t's that time again; Apple has shipped a new version of OS X, 10.10 Yosemite. Apple ships PHP 5.5.14 with Yosemite and this is how to set it up from a clean install. However, if you don't want to use the built-in PHP or want to use version 5.6, then these are some alternatives [including the Liip binary package, Homebrew or Zend Server 7.x).

He opts for the Homebrew method, installing it first then getting into the PHP and MySQL packages. This is all done from the command-line, so you'll need to be comfortable there. He includes the commands needed to install PHP, MySQL and Apache along with all configuration changes to make them work together. He also shows how to install Xdebug, PEAR, Composer and the Mcrypt & Intl extensions if needed.

tagged: setup osx yosemite mysql homebrew package install apache intl mcrypt

Link: http://akrabat.com/php/setting-up-php-mysql-on-os-x-yosemite/

NetTuts.com:
Xdebug - Professional PHP Debugging
Aug 29, 2013 @ 14:56:01

On NetTuts.com there's a new article introducing Xdebug, a powerful tool that can help you with debugging your PHP applications. It works by investigating what's happening "on the inside" and reporting it back to your debugger.

Well, technically, Xdebug is an extension for PHP to make your life easier while debugging your code. [...] But just imagine for a moment, as your applications evolve, you might get into the habit of sprinkling your code all over with little echos, var_dumps and custom debuggers. [...] The next question is: how do you debug in production? [...] Now lastly, have you ever wished to be able to step through your code, line by line, watch expressions, and even step into a function call to see why it’s producing the wrong return value? Well, you should definitely dig into the world of professional debugging with Xdebug, as it can solve all of the problems above.

They walk you through the setup of a complete (MAMP-based) environment on an OSX installation. You'll also need Xcode and the command line tools to be able to compile Xdebug. They recommend installing Homebrew to make installing the needed tools easier. They use Homebrew to install the PHP 5.4 version of Xdebug which then compiles and outputs a shared module you can put in your PHP extensions directory.

On the other side of things, the article also helps you set up your IDE, in this case PHPStorm but it would work for lots of others - to accept the debug messages from the server. He includes a sample script with some calls to the Xdebug-enabled debugging functions and what kind of responses (with screenshots) you should see in your IDE.

tagged: xdebug debugging extension homebrew mamp osx install tutorial

Link: http://net.tutsplus.com/tutorials/tools-and-tips/xdebug-professional-php-debugging/

Alex Simonenko's Blog:
Installing PHP 5.3.6 on OS X Lion
Jul 20, 2011 @ 16:27:30

Alex Simonenko has a new post to his blog talking about what he had to do to get PHP 5.3.6 working on his OS X Lion installation since a previous method no longer worked. in his new post he shares his solution - using Homebrew. (Note: original post is in Russian)

After installing OS X Lion (10.7) was faced with an unpleasant problem, install PHP + MySQL bundle as I did before does not work. And as it turned out, the problem is in MySQL, source code is not yet ready for the new OS from Apple. After some thought and reading similar problems on the Internet, I found [a solution to the problem].

He includes the commands you'll need to get Homebrew installed and configured to install a fresh download of the archive (dmg) after a few setup changes. He uses Homebrew to install a few dependencies the installation will need and his example configure options for the build. Then the install is just a "make" and "make install" away.

tagged: install homebrew tutorial osx lion version

Link:

Rob Allen's Blog:
MongoDB on OS X with the stock PHP installation
Jun 07, 2010 @ 16:07:08

After a bit of trial and error Rob Allen was able to get MongoDB up and running on his local OS X installation of PHP. He's blogged about how he did it with the help of the homebrew tool.

MongoDB was mentioned a few times at tek and I said that I wanted to have a look at. Travis' article, MongoDB: A first look, came out a few days ago and piqued my interest further. Then Matthew sent me some source code that requires it. The stage was set for getting MongoDB working on my Mac.

Using the homebrew utility he was able to easily install MongoDB itself and setting up PHP support for it was as simple as calling the "pecl" command line to grab and build the shared object. Drop it into your php.ini file and you're all set to go.

tagged: mongodb osx install homebrew tutorial

Link:

Sean Coates' Blog:
PHP 5.3 on Snow Leopard
May 26, 2010 @ 18:03:00

Due to the popularity (and age) of his previous post about compiling PHP 5.3 on Snow Leopard (OS X), Sean Coates has written an updated post showing some of the changes to the process that the updated OS version has brought with it.

I've been meaning to post instructions on how to compile PHP for Snow Leopard since last summer when I picked up the DVD, but hadn't found the time or opportunity to build PHP from a completely fresh start, until a few weeks ago. This time, I took notes on how to reliably compile PHP and Apache from scratch on this system.

He's made a six step process that includes installing Xcode, Homebrew, your own version of iconv, support for whatever dependencies you might still need and, of course, Apache/PHP.

tagged: compile php5 snowloepard osx homebrew xcode

Link:


Trending Topics: