Categories
DevOps Workflow

Homebrew PHP Monitor Broken

I think this happened when something interrupted the switch.

brew install php got me on the way.

Categories
DevOps

Zip / Tar GZ Ubuntu

Create Archive

tar -zcf mynewarchive.tar.gz mytargetdir

Extract Archive

tar -xzf myarchive.tar.gz 
  • c – Compress
  • x – Extract
  • z – Zip file (aka .gz)
  • f – File to operate on
Categories
DevOps

WSL2

I setup a sample Laravel app with Sail. Works, but I have to disable local Apache and MySQL to free up their ports. Should be able to configure the virtual host to use different host ports, but I couldn’t figure out the syntax.

Twitter pointed out that the slowness is due to file system syncing.

I have to investigate this for Laravel, and URL mapping. Would I have to setup PHP, Nginx etc directly in the VM? Then I’m losing the benefit of Sail configuring that for me.

I’m probably missing something obvious.

Categories
DevOps Workflow

Upgrading to PHP8.0 Locally

Added PHP8.0 with Homebrew. I’m using the shivammathur/homebrew-php tap as recommended in Brent’s post.

Steps

  • brew tap shivammathur/php
  • brew install shivammathur/php/php@8.0
    That seemed to immediately link it. CLI reported 8.0 after that ran.
  • Nginx automatically used it via php-fpm once I restarted Nginx and the PHP service (and Redis)
nginx-restart //(custom alias I have set in .zshrc)
brew services restart php
brew services restart redis

Switching Versions

I think this will just be a matter of brew linking the desired version (if already installed), and restarting php/nginx.

brew link --overwrite --force php@8.0

I’m not totally sure what the old 7.4 is called as far as Brew is concerned. It was the default back when I installed it, so maybe it’s just php , or possibly php@7.4

(A similar thing will probably happen now that PHP 8.1 is the default. I installed PHP 8.0 when it was, so it’s just php . Is it now php@8.0 ?)

Categories
DevOps Servers

Envoyer Deployments

Update: build is passing. Now configure Envoyer to not deploy on push, but instead wait for webhook call from Chipper CI.


Not yet working for HadCoffee staging site. The clone and setup fails because ‘mike’ user that I am connecting with needs to use sudo to interact with the www-data files. Envoyer doesn’t sudo the commands.

Not sure if my Ubuntu users are incorrect, or if Envoyer should be using a different user that can do its work without sudo. Probably the latter.


Changed project to be owned and group of mike, which Envoyer uses. Now it can deploy.

I did have to manually make storage (symlinked) belong to www-data so Nginx can write there.

Now just need npm/node to work. I really don’t know why it isn’t, but it’s stopping me from building the CSS & JS.


npm install worked now that it’s owned by mike.

Potential remaining issues to test with future deployments:

  • Do Frontend assets build now?
  • Is .env maintained? Was I right to create the file?
  • Are file uploads, and S3 push working?

General question: How do DB migrations work in production?