TL;DR Technology moving on and what was deprecated is obsolete now. But fear not, Docker here to solve the problem. See the answer below to see how I create a CakePHP 3.6 project on macOS Ventura.
Here, in 2023, I have my Mac updated to Ventura (13.0.1) with brew installed (Homebrew 3.6.18) and I have this requirement to create a CakePHP project, specifically version 3.6 (I am very well aware of CakePHP 3.x End of Support - but life happens). Now the scene was set, let's go and rock-and-roll!
Heading to installation documentation yields these;
- Install PHP - per documentation PHP 7.4 is supported, yay (sort of)
- Install Composer - there is at least one another alternative, the Oven way, but I haven't tried it
- Create a CakePHP Project
OK, let me install PHP. Oh, I already PHP installed via brew, PHP 8.2.1. Good then let me check if I already have Composer installed as well, composer --version
; yes "Composer version 2.4.4 2022-10-27 14:39:29". So the last thing I need to do is to Create a CakePHP Project. Let me run composer create-project --prefer-dist cakephp/app:"^3.6" my_app_name
;
Creating a "cakephp/app:^3.6" project at "./my_app_name"
Info from https://repo.packagist.org: #StandWithUkraine
Installing cakephp/app (3.10.1)
- Installing cakephp/app (3.10.1): Extracting archive
Created project in /Users/johndoe/Code/my_app_name
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- cakephp/cakephp[3.10.0, ..., 3.10.5] require php >=5.6.0,<8.0.0 -> your php version (8.2.1) does not satisfy that requirement.
- Root composer.json requires cakephp/cakephp 3.10.* -> satisfiable by cakephp/cakephp[3.10.0, ..., 3.10.5].
Oh, noes . Well, let me downgrade my PHP version, or better yet let brew install PHP 7.4 side-by-side (actually it was not a "better yet"). Quick Googling yield Update PHP to 7.4 macOS Catalina with brew on SO. Hmm, I'm on Venture and this is for Catalina. But there is one comment;
This solution works perfectly in MacOS BigSur.
I took juanitourquiza's word for it, besides there's nothing to lose... Except for those irritating "libicuio.71.dylib no such file" errors. It turned out that "Xcode 7.1 changed the name of some libraries now it uses .tdb files.". Bummer!
There I was scratching my head, I thought to myself "well I'm already going to use Docker to serve the app anyway (locally), why not use Docker to create the project too?".