Skip to main content

lando PHP version issue 7.4.x instead wanting >= 8.0.2

I installed Lando 3.6.2 and Laravel 9.  When I visit the web page, I getting

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /app/vendor/composer/platform_check.php on line 24

 

Problem solving

Opening the directory in VS Code, if I run the command 

php -v

The response I'm getting is

Deprecated function: trim() PHP

Updating to PHP 8.1, I found this interesting code stop...

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in bales_preprocess() (line 162 of /var/www/{path/to/file})

What is trim(). Very simply, it removes whitespaces (if they exist) at the start or end of a string.

Run Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1

Running Docker

Dangerous word... I'm assuming that Docker is installed.  Don't know how to check?  Using Terminal (I prefer iTerm2), run the following command

docker -D info

 

The set-up

Go to your project directory, and create a docker folder and a “docker-compose.yml” file:

Changing the author name from username to a first and last name

A bug bear that I have had for a while with Drupal content is how come the author of an article is actually their username.  I have an array of reasons to vent my dislike for this strategy... however, instead I will show you how to change it.  Albeit, programmatically!  Don't stress there actually isn't a huge amount of code to add.  In time I'll create a module so no coding is required.

 

Subscribe to PHP