Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

garynewport's avatar

Issue with Mojave 10.14, MySQL and PHP 7.3

Hi

I have just cleared off my Macbook Air (reset it) and am now about to install Laravel. The reset was partly prompted by an issue between Laravel and MySQL (which I believe is, in fact, between PHP and MySQL).

So, here I am with a clean Mojave 10.14 Macbook Air laptop; about to install...

Well, here is the rub.

If I start to install MySQL I am instructed to use the SHA256 enhanced encryption routine (MySQL 8). This is where the issue was before, since Laravel would not connect to MySQL.

The issue appears to be PHP, and Mojave installed PHP 7.1 by default, but it makes sense to upgrade this to 7.3

Yet, when I go to do so I am told by the installer that Mojave 10.14 creates a serious issue; meaning that PHP will now not work with Apache.

So, I think about upgrading Apache; but do I need to? How do I get PHP 7.3 to work with the installed Apache on the Mac? Do I need to? Or should I run with the pre-installed 7.1; but then how do I get MySQL to communicate with Laravel if the SHA256 issue arises again?

I do recall that the last time I tried this, MySQL used an IP along the lines of 196.x.y.z whilst Laravel through Composer was using 127.0.0.1.

Should they not be the same IP? If so, how do I get that to happen (given I have addressed the issues described above - which I haven't yet solved)?

0 likes
9 replies
aurawindsurfing's avatar

Hi @garynewport

When you say install what do you mean? How do you install your tools on your mac? Do you use brew?

Top of my head things that work well for me since 3 osx versions:

brew composer valet mysql or mariadb

in that order. Let us know what is the exact stack that you are trying to install.

1 like
garynewport's avatar

Hi @aurawindsurfing

I originally followed the laracast videos for installing Composer and Laravel via the command line.

I had Laravel working fine in basic mode (I could build a few static pages and view them via 127.0.0.1). I then wanted to connect to a database system. This is where I thought MySQL would work, so pulled down the DMG from the site directly (mysql.com) - and it was here that I started to encounter issues.

I tried to get my Laravel site to connect to the database but got an error about the SHA256 encryption - something that appears to be quite a common issue. I then found that the latest version of MySQL (MySQL 8) has a new encryption system that is "not supported by PHP" (quoted, as this is what I believe I read on a few sites).

Due to lots of code build up over the last few months I thought it would be nice to clear my laptop completely and start afresh. So, I pulled down iTerm2, and got to the point of installing (DMG) MySQL - then got to the choice on encryption (new enhanced or the legacy approach). I don't want to build upon something that is already old technology, so feel that the legacy approach is the wrong direction. Yet, I then would need to upgrade PHP from the default 7.1 to 7.3 (that is what a few sites have implied and, again, makes sense in terms of maintaining the latest stable versions of everything). Yet here lies the problem, since this then stops working with Apache...and so on.

I have used brew in the past but am trying to avoid it as I want to see what is going where and I still find brew confusing. More cowardice than anything else.

aurawindsurfing's avatar
Level 50

Hi @garynewport

The short answer to all of your troubles is actually brew. Like it or not it is just like an appstore but for your command line. This is by far the easiest and most convenient way to install stuff on your mac.

Here is example of everything I have installed via brew on my mac, all I needed to do was brew install mysql or brew install composer

Screenshot-2019-07-28-22-09-49

Then nest super cool brew feature is brew services list which will give you list of all you started and stopped services:

Screenshot-2019-07-28-22-13-07

Now here is a list of few steps to get you up and running with laravel and valet which is really good option. The biggest challange could be having composer in your path.

brew install php73
brew install composer

now this is important step:

echo $PATH

type this in your terminal and see if you can see in there composer/vendor/bin if not then run this command:

export PATH=$PATH:~/.composer/vendor/bin

run echo $PATH again and make sure composer is there. Now you are ready to install the rest of the stuff.

brew install mysql
composer global require laravel/valet
valet install

verify if valet is installed:

valet -v

Any questions, just ask.

Hope it helps!

1 like
garynewport's avatar

Thanks again @aurawindsurfing and sorry for not replying earlier.

I agreed with you immediately and started to install everything you stated but then went to Verona for a few days, hence the silence.

I have just finished installing as you stated and am curious in relation to valet; what is it?

I have now got to sort out an editor.

aurawindsurfing's avatar

Have read here: https://laravel.com/docs/master/valet#introduction

Valet is a Laravel development environment for Mac minimalists. No Vagrant, no /etc/hosts file. You can even share your sites publicly using local tunnels. Yeah, we like it too.

Laravel Valet configures your Mac to always run Nginx in the background when your machine starts. Then, using DnsMasq, Valet proxies all requests on the *.test domain to point to sites installed on your local machine.

In other words, a blazing fast Laravel development environment that uses roughly 7 MB of RAM. Valet isn't a complete replacement for Vagrant or Homestead, but provides a great alternative if you want flexible basics, prefer extreme speed, or are working on a machine with a limited amount of RAM.

As for editor go for https://code.visualstudio.com/ it is super easy to start with.

Actually here are some goodies. Install this extension first before any other: https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync

Once you do so, use this extension to pull in my settings from my public gist: https://gist.github.com/aurawindsurfing/4e1290569244094d6ccd0ea81d9c9177

This should install all extensions needed for laravel + some extra stuff.

Enjoy!

1 like
garynewport's avatar

Funnily enough I had read that, and realised that my editor for Java (NetBeans) will work with my intended Laravel projects (I believe anyway).

One issue I am having; I followed your instructions and yet I cannot create a project using Laravel command (laravel new myProject); Laravel is not installed.

I have composer (checked), mysql (checked) and valet (checked), but not laravel?

Do I need to install this separately?

garynewport's avatar

I am incredibly grateful for your help; thank you.

I know from my own experience that it can be frustrating appearing to walk someone through what they need to do; thinking that they should simply do some reading. The fact that you have taken the time to direct me has been so beneficial, as the reading I am doing elsewhere for lots of other things means that to get my head around the why and how of this would be too long for me to invest right now - a catch-22 from my side.

So, thank you for the help; all appears to be working now. :)

1 like

Please or to participate in this conversation.