Valetplus installation on Mac Catalina: fix No releases available for package pecl.php.net/apcu

Valetplus is a great development enironment. Running on Nginx, PHP, DnsMasq, Mailhog, Mysql or MariaDB, Redis and Elastic Search, it is a pretty complete off-the-shelf complete setup out-of-the-box. Easily switching between PHP versions and Valet's small footprint are just a few of the benefits.

Hover, the current version is not offcially compatible with Mac OS Catalina. Which is a shame, because you can run install and run it on a clean Catalina install, if you get around a few caveats. I faced two errors: 

  1. No releases available for package "pecl.php.net/apcu"
  2. Setting password for root user failed.

Here's how I fixed them.

No releases available for package "pecl.php.net/apcu"

PECL packages need a proper openssl setup. PHP looks for openssl in /usr/local/etc/openssl. But Valetplus installs it in /usr/local/etc/openssl@1.1.

## Create a symlink to the installed openssl
ln -s /usr/local/etc/openssl@1.1 /usr/local/etc/openssl

## Install Valet again. In my case, with MariaDB
valet install --with-mariadb

## Start Valet
valet start

Setting password for root user failed

After Valet properly installed, I could not connect to MySQL. Bummer. ERROR 1698 (28000): Access denied for user 'root'@'localhost'.

I got around this by running mysql_secure_installation and setting the root password explicitely.

## Set the password for user root explicitely.
## Follow the steps on the screen
sudo mysql_secure_installation

## Change the root password? Yes
## Remove anonymous users? Yes
## Disallow root login remotely? Yes
## Remove test database and access to it? Yes
## Reload privilege tables now? Yes

 After this, you can log into mysql like normal, using you new password: mysql -u root -p