Git Product home page Git Product logo

php's Introduction

PHP Lando Plugin

This is the official Lando plugin for PHP. When installed it...

  • Allows users to run various php versions
  • Serves applications over nginx or apache
  • Runs in cli mode
  • Comes with easy composer support

Of course, once a user is running their PHP project with Lando they can take advantage of all the other awesome development features Lando provides.

Basic Usage

Add a php service to your Landofile

services:
  myservice:
    type: php:8.1
    via: nginx
    webroot: www

For more info you should check out the docs:

Issues, Questions and Support

If you have a question or would like some community support we recommend you join us on Slack.

If you'd like to report a bug or submit a feature request then please use the issue queue in this repo.

Changelog

We try to log all changes big and small in both THE CHANGELOG and the release notes.

Maintainers

Contributors

Made with contributors-img.

Other Selected Resources

php's People

Contributors

chrillep avatar davereid-pfg avatar ddrager avatar dependabot[bot] avatar github-actions[bot] avatar pfrenssen avatar phpsa avatar pirog avatar reynoldsalec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

php's Issues

Windows10 Pro lando drush issue

Basically any other task or issue should go here. Try to frame it as a user story if it makes sense.
I'm trying to make Lando work in Windows10
I was able to install lando, it actually works, but I have issues with Drush

OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec format error": unknown

This is my .lando.yml
name: sitename recipe: pantheon config: webroot: web framework: drupal8 site: sitename id: ID tooling: local-load-db: service: appserver description: Load database cmd: /app/local/import.sh level: app

I'm not sure what the issue is, and I've been trying to find out what is happening, but I have no idea.

I also have issues at running our local scripts, but unless Drush works first, it's futile.

Release new version w/ updated PHP plugin for 8.3

Hello,

Can we get new version released in order to use php 8.3? It had been more than 2 months since the release and it is still not available in lando.
Also, bear in mind that I tried manual update of php plugin and got error when starting 8.3 image.

The error_reporting setting excludes E_DEPRECATED notices

Hi,

I was wondering why the error_reporting setting is set to E_ALL & ~E_DEPRECATED (see line 42 of the local php.ini ) instead of E_ALL.

The development version of the php.ini of PHP itself sets the value error_reporting to E_ALL:

https://github.com/php/php-src/blob/PHP-7.4/php.ini-development#L484
https://github.com/php/php-src/blob/PHP-8.0/php.ini-development#L484
https://github.com/php/php-src/blob/PHP-8.1/php.ini-development#L484

Other development solutions for PHP that I am familiar with, Homebrew and Docksal, also adhere to this default.

I prefer to have this included, as it helps in finding potential deprecations early.

But maybe there is a valid reason to exclude E_DEPRECATED notices that I'm not aware of.

Thanks.

Aad

rebuild images, update from 8.1.10 to php 8.1.13

https://www.php.net/ChangeLog-8.php#8.1.12

PHP 8 ChangeLog

8.1 | 8.0

Version 8.1.12

27 Oct 2022

  • Core:
    • Fixes segfault with Fiber on FreeBSD i386 architecture.
  • Fileinfo:
    • Fixed bug GH-8805 (finfo returns wrong mime type for woff/woff2 files).
  • GD:
    • Fixed bug #81739: OOB read due to insufficient input validation in imageloadfont(). (CVE-2022-31630)
  • Hash:
  • MBString:
    • Fixed bug GH-9683 (Problem when ISO-2022-JP-MS is specified in mb_ encode_mimeheader).
  • Opcache:
    • Added indirect call reduction for jit on x86 architectures.
  • Session:
    • Fixed bug GH-9583 (session_create_id() fails with user defined save handler that doesn't have a validateId() method).
  • Streams:
    • Fixed bug GH-9590 (stream_select does not abort upon exception or empty valid fd set).

Version 8.1.11

29 Sep 2022

  • Core:
    • Fixed bug #81726: phar wrapper: DOS when using quine gzip file. (CVE-2022-31628)
    • Fixed bug #81727: Don't mangle HTTP variable names that clash with ones that have a specific semantic meaning. (CVE-2022-31629)
    • Fixed bug GH-9323 (Crash in ZEND_RETURN/GC/zend_call_function) (Tim Starling)
    • Fixed bug GH-9361 (Segmentation fault on script exit #9379).
    • Fixed bug GH-9447 (Invalid class FQN emitted by AST dump for new and class constants in constant expressions).
  • DOM:
    • Fixed bug #79451 (DOMDocument->replaceChild on doctype causes double free).
  • FPM:
    • Fixed bug GH-8885 (FPM access.log with stderr begins to write logs to error_log after daemon reload).
    • Fixed bug #77780 ("Headers already sent..." when previous connection was aborted).
  • GMP:
    • Fixed bug GH-9308 (GMP throws the wrong error when a GMP object is passed to gmp_init()).
  • Intl:
    • Fixed bug GH-9421 (Incorrect argument number for ValueError in NumberFormatter).
  • PCRE:
    • Fixed pcre.jit on Apple Silicon.
  • PDO_PGSQL:
    • Fixed bug GH-9411 (PgSQL large object resource is incorrectly closed).
  • Reflection:
    • Fixed bug GH-8932 (ReflectionFunction provides no way to get the called class of a Closure).
  • Streams:
    • Fixed bug GH-9316 ($http_response_header is wrong for long status line).

relates to:
#41

Drupal 8 Nginx blocks `/.well-known` routes, works on Apache

recipe: drupal8
config:
  webroot: web
  php: '7.2'
  via: apache
  database: mariadb:10.1
  drush: ^10

.well-known/openid-jwks works with openid_connect_autodiscovery module

recipe: drupal8
config:
  webroot: web
  php: '7.2'
  via: nginx
  database: mariadb:10.1
  drush: ^10

.well-known/openid-jwks if 404 file not found Nginx responce

Allow a .htaccess-lando to override .htaccess

I'm trying to override the .htaccess file as instructed in https://docs.lando.dev/config/apache.html#configuration. Adding .htaccess-lando next to the Drupal root .htaccess file doesn't do anything. I have tried rebuilding and also tried adding the custom httpd.conf file taken from https://github.com/lando/lando/tree/master/plugins/lando-services/services/apache. Any ideas how I can get this working?

screen

Running Lando v3.0.3 on Windows 10.

name: thingymajig
recipe: drupal7
config:
  php: '7.2'
  via: apache
  webroot: web
  database: mariadb
  drush: ^8
  xdebug: false
  config:
    php: .lando/.lando.php.ini
    database: .lando/.lando.mysql.cnf
    server: .lando/httpd.conf
    vhosts: .lando/default.conf

proxy:
  appserver:
    - thingymajig.lndo.site
    - www.thingymajig.lndo.site
  mailhog:
    - mail.thingymajig.lndo.site
  pma:
    - pma.thingymajig.lndo.site
  adminer:
    - adminer.thingymajig.lndo.site

services:
  database:
    creds:
      database: thingymajig
      user: thingymabob
      password: easylike123
  appserver:
    overrides:
      environment:
        # Support debugging Drush with XDEBUG.
        PHP_IDE_CONFIG: "serverName=appserver"
  mailhog:
    type: mailhog
    hogfrom:
      - appserver
    portforward: true
  pma:
    type: phpmyadmin
    hosts:
      - database
  adminer:
    type: compose
    services:
      image: dehy/adminer
      command: /bin/s6-svscan /etc/services.d
    portforward: true

tooling:
  xon:
    service: appserver
    description: Enable xdebug for apache.
    cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
    user: root
  xoff:
    service: appserver
    description: Disable xdebug for apache.
    cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
    user: root

excludes:
  - .idea
  - .git

Why should Lando enable MultiViews, which is disabled by Apache default?

Why "Options Indexes FollowSymLinks MultiViews" ?

I built a Drupal site with Lando and created a page called /example, but I got an Apache 404 Not Found.
This is because the "example.gitignore" file exists directly under the document root, and the MultiViews could not find the extension "gitignore".
By the way, ".htaccess" does not have a description to enable MultiViews. After some research, I found that MultiViews was enabled in Apache's VirtualHost options.

Options Indexes FollowSymLinks MultiViews

Options Indexes FollowSymLinks MultiViews

Options Indexes FollowSymLinks MultiViews

I looked at https://httpd.apache.org/docs/current/en/mod/core.html#Options to see what the Apache defaults are for this, but it seems that the only default value is Options FollowSymlinks.

I'm not sure why you needed to enable MultiViews, but at least it's hurting Drupal development.

I hope you can improve.
thank you.

Open up port 6001 for laravel-websockets (php via cli service)

I'm trying to figure out how to run laravel-websockets with lando.
https://beyondco.de/docs/laravel-websockets/getting-started/introduction
laravel-websockets is a PHP CLI Ratchet application running on port 6001.

This is my lando file:

name: lintex
recipe: laravel
config:
  webroot: public
  php: '7.4'
  composer_version: '2.0.4'
  via: nginx
  database: mysql:8.0
  cache: redis
excludes:
  - vendor
  - node_modules
proxy:
  appserver_nginx:
    - lintex.local
    - "*.lintex.local"
  websockets:
    - lintex.local:6001
services:
  database:
    type: mysql:8.0
    portforward: 3306
    creds:
      user: lintex
      password: lintex
      database: lintex
  horizon:
    type: php:7.4
    via: cli
    command: php /app/artisan horizon
  websockets:
    type: php:7.4
    via: cli
    portforward: 6001
    ports:
      - '6001'
    command: php /app/artisan websockets:serve
bindAddress: "0.0.0.0"

It seems the port 6001 is not accessible from the host.
The websockets service also needs to be accessable from the other services.

php cli version is not updated!

Using Drupal 10 recipe, one of the new feature of Drupal 10 is Starterkit Theme Generator which uses php cli.
In lando on my Mac, the version of current php cli always PHP 7.3.29.

lando-docker-php (web) info:
config: { php: '/Users/mojave_sub/.lando/config/drupal10/php.ini' }, version: '8.1',

php cli error:

$ php core/scripts/drupal generate-theme --help
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.3.29. in /Users/me/Documents/localwebsite/dp10app/vendor/composer/platform_check.php on line 24

I checked php version like below:

$ php -v
PHP 7.3.29 (cli) (built: Aug 15 2021 23:10:16) ( NTS )

Changing lando.yml like below doesn't work:

name: my-land-drupal10-app
recipe: drupal10
config:
  webroot: web
  php: '8.1'  <----added here
services:
  phpmyadmin:
    type: phpmyadmin
  myservice: <----added here
    type: php:8.1 <----added here
    via: cli <----added here

I did lando destroy -y && lando start after editing lando.yml.

I suspect composer installed by lando, so I tried to run composer update and it failed as:

$ composer update
-bash: composer: command not found
$ sudo composer update
Password:
sudo: composer: command not found

Then, I editted composer.json under app project folder as:

    "config": {
        "platform": {<----added here
            "php": "8.1"<----added here
        },<----added here
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true,
            "phpstan/extension-installer": true,
            "dealerdirect/phpcodesniffer-composer-installer": true
        },
        "sort-packages": true
    },

And I did lando destroy -y && lando start that ended up with this error and it has not solved yet!:
`Starting landoproxyhyperion5000gandalfedition_proxy_1 ...

ERROR: for landoproxyhyperion5000gandalfedition_proxy_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for proxy UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 300).
ERROR ==> message=, stack=Error
at /snapshot/cli/lib/shell.js
From previous event:
at Shell.sh (/snapshot/cli/lib/shell.js)
at Object.dc (/snapshot/cli/lib/bootstrap.js)
at compose (/snapshot/cli/lib/bootstrap.js)
at /snapshot/cli/lib/router.js
at /snapshot/cli/lib/router.js
at processImmediate (internal/timers.js:464:21)
From previous event:
at retryEach (/snapshot/cli/lib/router.js)
at Object.start (/snapshot/cli/lib/router.js)
at /snapshot/cli/lib/engine.js
at /snapshot/cli/lib/router.js
From previous event:
at Object.eventWrapper (/snapshot/cli/lib/router.js)
at Engine.engineCmd (/snapshot/cli/lib/engine.js)
at Engine.start (/snapshot/cli/lib/engine.js)
at /snapshot/cli/plugins/lando-proxy/app.js
From previous event:
at AsyncEvents. (/snapshot/cli/plugins/lando-proxy/app.js)
at AsyncEvents.handle (/snapshot/cli/lib/events.js)
at /snapshot/cli/lib/events.js
at processImmediate (internal/timers.js:464:21)
From previous event:
at AsyncEvents.emit (/snapshot/cli/lib/events.js)
From previous event:
at App.start (/snapshot/cli/lib/app.js)
at /snapshot/cli/lib/app.js
From previous event:
at App.rebuild (/snapshot/cli/lib/app.js)
at Object.run (/snapshot/cli/plugins/lando-core/tasks/rebuild.js)
From previous event:
at /snapshot/cli/lib/cli.js
From previous event:
at Object.handler (/snapshot/cli/lib/cli.js)
at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
at Cli.init (/snapshot/cli/lib/cli.js)
at Cli.run (/snapshot/cli/lib/cli.js)
From previous event:
at /snapshot/cli/bin/lando.js
From previous event:
at Object. (/snapshot/cli/bin/lando.js)
at Module._compile (pkg/prelude/bootstrap.js:1794:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.runMain (pkg/prelude/bootstrap.js:1847:12)
at internal/main/run_main_module.js:17:47, stackCleaned=true
Creating network "mylanddrupal10appv2_default" with the default driver
Creating volume "mylanddrupal10appv2_data_appserver" with default driver
Creating volume "mylanddrupal10appv2_home_appserver" with default driver
Creating volume "mylanddrupal10appv2_data_database" with default driver
Creating volume "mylanddrupal10appv2_home_database" with default driver
Creating volume "mylanddrupal10appv2_data_phpmyadmin" with default driver
Creating volume "mylanddrupal10appv2_home_phpmyadmin" with default driver
Creating volume "mylanddrupal10appv2_data_myservice" with default driver
Creating volume "mylanddrupal10appv2_home_myservice" with default driver
Creating mylanddrupal10appv2_myservice_1 ...

ERROR: for mylanddrupal10appv2_myservice_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for myservice UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 300).
ERROR ==> message=, stack=Error
at /snapshot/cli/lib/shell.js
From previous event:
at Shell.sh (/snapshot/cli/lib/shell.js)
at Object.dc (/snapshot/cli/lib/bootstrap.js)
at compose (/snapshot/cli/lib/bootstrap.js)
at /snapshot/cli/lib/router.js
From previous event:
at retryEach (/snapshot/cli/lib/router.js)
at Object.start (/snapshot/cli/lib/router.js)
From previous event:
at /snapshot/cli/lib/router.js
at processImmediate (internal/timers.js:464:21)
From previous event:
at Object.run (/snapshot/cli/lib/router.js)
at run (/snapshot/cli/lib/engine.js)
at /snapshot/cli/lib/router.js
From previous event:
at Object.eventWrapper (/snapshot/cli/lib/router.js)
at Engine.engineCmd (/snapshot/cli/lib/engine.js)
at Engine.run (/snapshot/cli/lib/engine.js)
at Object.runBuild (/snapshot/cli/plugins/lando-services/lib/utils.js)
at AsyncEvents. (/snapshot/cli/plugins/lando-services/app.js)
at AsyncEvents.handle (/snapshot/cli/lib/events.js)
at /snapshot/cli/lib/events.js
From previous event:
at AsyncEvents.emit (/snapshot/cli/lib/events.js)
From previous event:
at App.start (/snapshot/cli/lib/app.js)
at /snapshot/cli/lib/app.js
From previous event:
at App.rebuild (/snapshot/cli/lib/app.js)
at Object.run (/snapshot/cli/plugins/lando-core/tasks/rebuild.js)
From previous event:
at /snapshot/cli/lib/cli.js
From previous event:
at Object.handler (/snapshot/cli/lib/cli.js)
at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
at Cli.init (/snapshot/cli/lib/cli.js)
at Cli.run (/snapshot/cli/lib/cli.js)
From previous event:
at /snapshot/cli/bin/lando.js
From previous event:
at Object. (/snapshot/cli/bin/lando.js)
at Module._compile (pkg/prelude/bootstrap.js:1794:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.runMain (pkg/prelude/bootstrap.js:1847:12)
at internal/main/run_main_module.js:17:47, stackCleaned=true
Starting mylanddrupal10appv2_myservice_1 ...
Creating mylanddrupal10appv2_phpmyadmin_1 ...
Creating mylanddrupal10appv2_appserver_1 ...
Creating mylanddrupal10appv2_database_1 ...

ERROR: for mylanddrupal10appv2_myservice_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for mylanddrupal10appv2_database_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for mylanddrupal10appv2_appserver_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for mylanddrupal10appv2_phpmyadmin_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for myservice UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for database UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for appserver UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)

ERROR: for phpmyadmin UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=300)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 300).
ERROR ==> `

Missing parsed ini Files in PHPStorm

My example is showed with php 8.1 but its the same Problem with php 8.0 and i think other Versions too.

As you can see the XSL ini File is not loaded/parsed in Storm.

From Storm
Bildschirmfoto 2021-12-22 um 15 22 38

From SSH
Bildschirmfoto 2021-12-22 um 15 24 22

How to reproduce
add to your lando yaml xsl docker-php-ext-install xsl.
Config the CLI Interpreter in Storm
done.

As you can see xdebug and other ini Files are working.

Some more tests
Via SSH CLI: php -dextensiion=/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so bin/phpunit
OK

Via Storm

[docker://devwithlando/php:8.1-apache-4/]:php -dextension=/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so /app/vendor/phpunit/phpunit/phpunit 
Testing started at 15:44 ...

Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902//usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902//usr/local/lib/php/extensions/no-debug-non-zts-20210902/xsl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Composer tooling results in "no such container" error

I'm running an M1 Pro Max Macbook Pro, with Lando version 3.6.5 and Docker version 4.8.2. I don't presently have access to an Intel Mac to see whether the error occurs on that platform, too.

The snippet below demonstrates the error when running install, although the problem happens with all composer commands:

❯ lando composer install
Error: No such container: localsite_app_1
ERROR: No such service: app

Here's how I've set up the tooling command, while trying to troubleshoot:

composer:
    service: appserver
    cmd:
      - php /usr/local/bin/composer

Here are the results of adding the -vvv flag to "lando composer install:

❯ lando composer install -vvv
lando 09:39:12 DEBUG ==> No update available. 
lando 09:39:12 VERBOSE ==> starting bootstrap at level engine... 
lando 09:39:12 VERBOSE ==> config bootstrap beginning... 
lando 09:39:12 DEBUG ==> emitting event pre-bootstrap-config 
lando 09:39:12 DEBUG ==> plugin lando-core loaded from /snapshot/cli/plugins/lando-core/index.js 
lando 09:39:12 DEBUG ==> plugin lando-events loaded from /snapshot/cli/plugins/lando-events/index.js 
lando 09:39:12 DEBUG ==> plugin lando-networking loaded from /snapshot/cli/plugins/lando-networking/index.js 
lando 09:39:12 DEBUG ==> plugin lando-proxy loaded from /snapshot/cli/plugins/lando-proxy/index.js 
lando 09:39:12 DEBUG ==> plugin lando-recipes loaded from /snapshot/cli/plugins/lando-recipes/index.js 
lando 09:39:12 DEBUG ==> plugin lando-services loaded from /snapshot/cli/plugins/lando-services/index.js 
lando 09:39:12 DEBUG ==> plugin lando-sharing loaded from /snapshot/cli/plugins/lando-sharing/index.js 
lando 09:39:12 DEBUG ==> plugin lando-test loaded from /snapshot/cli/plugins/lando-test/index.js 
lando 09:39:12 DEBUG ==> plugin lando-tooling loaded from /snapshot/cli/plugins/lando-tooling/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/acquia loaded from /snapshot/cli/node_modules/@lando/acquia/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/apache loaded from /snapshot/cli/node_modules/@lando/apache/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/backdrop loaded from /snapshot/cli/node_modules/@lando/backdrop/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/compose loaded from /snapshot/cli/node_modules/@lando/compose/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/dotnet loaded from /snapshot/cli/node_modules/@lando/dotnet/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/drupal loaded from /snapshot/cli/node_modules/@lando/drupal/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/elasticsearch loaded from /snapshot/cli/node_modules/@lando/elasticsearch/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/go loaded from /snapshot/cli/node_modules/@lando/go/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/joomla loaded from /snapshot/cli/node_modules/@lando/joomla/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/lagoon loaded from /snapshot/cli/node_modules/@lando/lagoon/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/lamp loaded from /snapshot/cli/node_modules/@lando/lamp/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/laravel loaded from /snapshot/cli/node_modules/@lando/laravel/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/lemp loaded from /snapshot/cli/node_modules/@lando/lemp/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mailhog loaded from /snapshot/cli/node_modules/@lando/mailhog/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mariadb loaded from /snapshot/cli/node_modules/@lando/mariadb/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mean loaded from /snapshot/cli/node_modules/@lando/mean/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/memcached loaded from /snapshot/cli/node_modules/@lando/memcached/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mongo loaded from /snapshot/cli/node_modules/@lando/mongo/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mssql loaded from /snapshot/cli/node_modules/@lando/mssql/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/mysql loaded from /snapshot/cli/node_modules/@lando/mysql/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/nginx loaded from /snapshot/cli/node_modules/@lando/nginx/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/node loaded from /snapshot/cli/node_modules/@lando/node/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/pantheon loaded from /snapshot/cli/node_modules/@lando/pantheon/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/php loaded from /snapshot/cli/node_modules/@lando/php/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/phpmyadmin loaded from /snapshot/cli/node_modules/@lando/phpmyadmin/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/platformsh loaded from /snapshot/cli/node_modules/@lando/platformsh/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/postgres loaded from /snapshot/cli/node_modules/@lando/postgres/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/python loaded from /snapshot/cli/node_modules/@lando/python/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/redis loaded from /snapshot/cli/node_modules/@lando/redis/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/ruby loaded from /snapshot/cli/node_modules/@lando/ruby/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/solr loaded from /snapshot/cli/node_modules/@lando/solr/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/symfony loaded from /snapshot/cli/node_modules/@lando/symfony/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/tomcat loaded from /snapshot/cli/node_modules/@lando/tomcat/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/varnish loaded from /snapshot/cli/node_modules/@lando/varnish/index.js 
lando 09:39:12 DEBUG ==> plugin @lando/wordpress loaded from /snapshot/cli/node_modules/@lando/wordpress/index.js 
lando 09:39:12 DEBUG ==> emitting event post-bootstrap-config 
lando 09:39:12 VERBOSE ==> building proxy config... 
lando 09:39:12 VERBOSE ==> config bootstrap completed. 
lando 09:39:12 VERBOSE ==> tasks bootstrap beginning... 
lando 09:39:12 DEBUG ==> emitting event pre-bootstrap-tasks 
lando 09:39:12 DEBUG ==> autoloaded task config 
lando 09:39:12 DEBUG ==> autoloaded task destroy 
lando 09:39:12 DEBUG ==> autoloaded task info 
lando 09:39:12 DEBUG ==> autoloaded task list 
lando 09:39:12 DEBUG ==> autoloaded task logs 
lando 09:39:12 DEBUG ==> autoloaded task poweroff 
lando 09:39:12 DEBUG ==> autoloaded task rebuild 
lando 09:39:12 DEBUG ==> autoloaded task restart 
lando 09:39:12 DEBUG ==> autoloaded task share 
lando 09:39:12 DEBUG ==> autoloaded task start 
lando 09:39:12 DEBUG ==> autoloaded task stop 
lando 09:39:12 DEBUG ==> autoloaded task version 
lando 09:39:12 DEBUG ==> autoloaded task init 
lando 09:39:12 DEBUG ==> autoloaded task ssh 
lando 09:39:12 DEBUG ==> emitting event post-bootstrap-tasks 
lando 09:39:12 VERBOSE ==> tasks bootstrap completed. 
lando 09:39:12 VERBOSE ==> engine bootstrap beginning... 
lando 09:39:12 DEBUG ==> emitting event pre-bootstrap-engine 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/plugins/lando-core/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/plugins/lando-proxy/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/plugins/lando-recipes/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/plugins/lando-services/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/plugins/lando-sharing/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/node_modules/@lando/acquia/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/node_modules/@lando/lagoon/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/node_modules/@lando/pantheon/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> automoved scripts from /snapshot/cli/node_modules/@lando/platformsh/scripts to /Users/jasonevines/.lando/scripts and set to mode 755 
lando 09:39:12 DEBUG ==> emitting event post-bootstrap-engine 
lando 09:39:12 VERBOSE ==> engine bootstrap completed. 
lando 09:39:12 VERBOSE ==> bootstrap completed. 
lando 09:39:12 DEBUG ==> emitting event post-bootstrap 
lando 09:39:12 VERBOSE ==> docker-engine exists: true 
lando 09:39:12 VERBOSE ==> docker-compose exists: true 
lando 09:39:12 DEBUG ==> emitting event cli-answers 
lando 09:39:12 DEBUG ==> emitting event cli-composer-answers 
lando 09:39:12 DEBUG ==> emitting event cli-run 
lando 09:39:12 DEBUG ==> emitting event cli-composer-run 
lando 09:39:12 DEBUG ==> emitting event pre-command-runner 
lando 09:39:12 DEBUG ==> emitting event pre-composer 
lando 09:39:12 DEBUG ==> process pid5 running /Applications/Docker.app/Contents/Resources/bin/docker exec localsite_app_1 php /usr/local/bin/composer install cstdio=[inherit, pipe, pipe], silent=false, mode=attach, detached=false
lando 09:39:12 VERBOSE ==> checking docker version compatibility... 
lando 09:39:12 DEBUG ==> compatibility results name=desktop, link=https://docs.docker.com/docker-for-mac/release-notes/, wants=2.1.0.0 - 3.6.99, version=4.8.2, semversion=4.8.2, semmin=2.1.0, semmax=3.6.99, dockerVersion=true, satisfied=false
Error: No such container: localsite_app_1
lando 09:39:12 DEBUG ==> process pid5 finished with exit code 1 
lando 09:39:12 DEBUG ==> engine is up. 
lando 09:39:12 DEBUG ==> docker is running. 
lando 09:39:12 DEBUG ==> engine is up. 
lando 09:39:12 DEBUG ==> process pid7 running /Applications/Docker.app/Contents/Resources/bin/docker-compose-v1/docker-compose up cstdio=inherit, silent=false, mode=spawn, detached=false
ERROR: No such service: app
lando 09:39:13 DEBUG ==> process pid7 finished with exit code 1 
lando 09:39:13 VERBOSE ==> reporting error action to report=true, url=https://metrics.lando.dev, report=true, url=https://metrics.lando.dev
lando 09:39:13 DEBUG ==> reported data command=lando composer,install, context=local, devMode=false, instance=a358bfe49393a9e5ae4636c478a952e19142530e, nodeVersion=v14.19.1, mode=cli, type=Darwin, platform=darwin, release=21.5.0, arch=arm64, product=lando, version=3.6.5, message=, stack=Error
    at /snapshot/cli/lib/shell.js
From previous event:
    at Shell.sh (shell.js)
    at Object.dc (bootstrap.js)
    at compose (bootstrap.js)
    at /snapshot/cli/lib/router.js
From previous event:
    at retryEach (router.js)
    at Object.start (router.js)
From previous event:
    at /snapshot/cli/lib/router.js
From previous event:
    at Object.run (router.js)
    at run (engine.js)
    at /snapshot/cli/lib/router.js
From previous event:
    at Object.eventWrapper (router.js)
    at Engine.engineCmd (engine.js)
    at Engine.run (engine.js)
From previous event:
    at /snapshot/cli/plugins/lando-tooling/lib/build.js
From previous event:
    at Object.run (build.js)
From previous event:
    at /snapshot/cli/lib/bootstrap.js
From previous event:
    at /snapshot/cli/lib/cli.js
From previous event:
    at Object.handler (cli.js)
    at Object.runCommand (command.js:238:44)
    at Object.parseArgs [as _parseArgs] (yargs.js:1063:30)
    at Function.get [as argv] (yargs.js:1004:21)
    at Cli.init (cli.js)
    at Cli.run (cli.js)
    at Object.<anonymous> (lando.js)
    at Module._compile (bootstrap.js:1887:22)
    at Function.runMain (bootstrap.js:1940:12)
    at internal/main/run_main_module.js:17:47, action=error, created=2022-05-31T14:39:13.469Z

Running composer commands inside the service shell (after doing lando ssh) works fine, however.

Add AVIF support to GD.

AVIF is picking up support(https://caniuse.com/avif) across most major browsers, so it would be great if we can get support in lando.

I did try to enable AVIF in GD following:
https://php.watch/versions/8.1/gd-avif

I was trying:

      - apt-get update -y
      - apt install libavif-dev libaom-dev libdav1d-dev -y
      - docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp --with-avif
      - docker-php-ext-install gd

(Unsure if ibaom-dev libdav1d-dev are actually necessary`)

Which shows:
Screenshot 2024-06-13 at 8 26 26 AM

However, I'm still getting errors around missing codec Could not encode image: No codec available in Command line code on line 1. From what I've found so far, it may require an upgrade to Debian 12(Bookworm).

XDebug connection drops when host IP address changes

This is the same issue as reported in lando/lando#1700. There is now a solution for this.

Currently when the PHP container is built XDebug is configured using the current host IP address in the XDEBUG_CONFIG environment variable (ref.

const xdebugConfig = host => ([
).

Example:

XDEBUG_CONFIG: client_host=192.168.1.116 discover_client_host=1 log=/tmp/xdebug.log remote_enable=true remote_host=192.168.1.116

Since the IP address is hardcoded this causes the XDebug connection to be lost when the host address changes (e.g. when switching to a different wifi network).

At the moment the only way to fix it is to run lando rebuild which will update the environment variables.

In the original issue it was mentioned (lando/lando#1700 (comment)) that the best solution would be to use host.docker.internal instead of hardcoding the IP but at the time the issue was created this was not yet supported in Linux. Support for this has been added in Docker version 20.10 (moby/moby#40007).

One potential snag is that on Linux the following host needs to be added to the Docker configuration: host.docker.internal:host-gateway. This is not needed on Windows and OSX.

How to access PHP error logs?

How can I access PHP error logs in Lando?

I've found several similar issues, but none of them allow you access to true error logs. At best they give you access to logs loosely related to PHP but are useless for resolving the cause of errors.

What I want is full access to error logs like you would be able to configure while hosting a site via localhost Apache and PHP.

Here's what I've attempted so far:

.lando.yml
(relevant pieces only)

config:
  framework: drupal7
  php: '7.1'
  via: apache
  database: mysql
  webroot: docroot
  drush: ^8
  xdebug: false
  config:
    # Custom PHP config overrides.
    php: lando/php-conf/php.ini
services:
  appserver:
    build_as_root:
      - touch /var/log/php_errors.log

Note that in the build process I am creating /var/log/php_errors.log.

lando/php-conf/php.ini

error_log = /var/log/php_errors.log

Then I followed these steps:

  • lando rebuild
  • lando ssh
  • php -i | grep error. Here I see error_log => /var/log/php_errors.log => /var/log/php_errors.log. This looks correct.
  • ls /var/log/. Here I see php_errors.log.
  • tail -f /var/log/php_errors.log. I see nothing.
  • I trigger a PHP error. I still see nothing in the tail process.

Am I missing something obvious? Wouldn't this be super useful for everyone? Thanks for any help.

XDEBUG 3 complains about xdebug.remote_autostart = 1 in /usr/local/etc/php/conf.d/xxx-lando-default.ini

When I run a current PHP Version in lando (eg 8.1) Xdebug (>=3) complains about config which is only compatible with XDEBUG2.

So every command which uses PHP like lando php -v results in a message like

$ lando php -v
Xdebug: [Config] The setting 'xdebug.remote_autostart' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_autostart (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
PHP 8.1.18 (cli) (built: May  3 2023 05:11:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies
    with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans

Global prestissimo installing when it shouldn't

Tell us about your setup
lando version: 3.0.21 on Ubuntu 20.10 using .deb from releases page
Example: v3.0.0-rc.2 on Windows 10 Professional

Tell us about your .lando.yml

Paste in the contents of your .lando.yml this is SUPER HELPFUL for us.

Example:

name: lamp2
recipe: lamp
config:
  php: '5.6'
  webroot: www
  database: mysql
  xdebug: true

It is also helpful to include other relevant config files. For example, include pantheon.yml for a pantheon recipe if applicable. Include php.ini or mysql.cnf if you are overriding our defualt config.

Tell us about the command you were running

From the lando docs

lando init \
  --source cwd \
  --recipe laravel \
  --webroot app/public \
  --name my-first-laravel-app

# Install laravel
lando ssh -c "composer global require laravel/installer && laravel new app"

lando poweroff
lando destroy

# destory all docker containers and images
docker rm everything
docker rmi everything

# emulate a project that had it installed already
composer require hirak/prestissimo --dev --ignore-platform-reqs
# probably output not liking prestissimo

# remove it
composer remove hirak/prestissimo

lando rebuild -y

Tell us about the error you got
This was the output from the contrived commands trying to start from scratch

All settings correct for using Composer
Downloading...

Composer (version 2.0.3) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Changed current directory to /var/www/.composer
hirak/prestissimo is not required in your composer.json and has not been removed
./composer.json has been updated
Running composer update hirak/prestissimo
Loading composer repositories with package information
Updating dependencies
Package "hirak/prestissimo" listed for update is not locked.

but for my actual work project this is what i got.

All settings correct for using Composer
Downloading...

Composer (version 2.0.3) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Changed current directory to /var/www/.composer
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
./composer.json has been updated
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Running composer update hirak/prestissimo
Loading composer repositories with package in

i would then need to manually run lando composer update --no-plugins for it to work "properly"

Tell us generally about your bug

Basically I was updating the project from Laravel 6 -> 7 -> 8. and in there composer updated to use v2. so i remove prestissimo as a dependency. but anytime i rebuilt the project or ran composer, it complained about prestissimo being installed globally.
after many lando destroys and poweroffs and rebuilds nothing worked. edit: looks like i needed to delete vendor and composer.lock as well

explicitly set composer_version: '2.0.8' and rebuilt. that seemed to have worked. but i may have had to deleted all of the docker images/containers again. I might have even deleted the lando settings (~/.lando) folder. it worked.

technically i could remove the composer_version after and rebuild, cuz it remembers something or grabs something that doesnt have prestissimo baked in already.

seems like some of the scripts when building from scratch were automatically removing prestissimo, but at least for my already working project. it did not. and caused a whole lotta grief

When using Composer 2.2, lando start/rebuild prompting to trust hirak/prestissimo right before it gets removed

All settings correct for using Composer
Downloading...

Composer (version 2.2.5) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Changed current directory to /var/www/.composer
hirak/prestissimo contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "hirak/prestissimo" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] n
./composer.json has been updated
Running composer update hirak/prestissimo
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 0 updates, 1 removal
  - Removing hirak/prestissimo (0.3.10)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 0 updates, 1 removal
  - Removing hirak/prestissimo (0.3.10)
Generating autoload files
Changed current directory to /var/www/.composer
./composer.json has been updated
Running composer update drush/drush
Loading composer repositories with package information
Updating dependencies

It would be good if this composer command when first starting a drupal9 Pantheon lando container ran with the -n flag to disable interaction, since it's touching an internal composer.json file.

How to override Lando's PHP-FPM settings

Here's a recipe for overriding Lando's default PHP-FPM settings. If necessary, adjust the name of the .lando folder.

.lando.yml

services:
  appserver:
    overrides:
      volumes:
        # Override default PHP-FPM settings.
        - ./.lando/php-fpm.conf:/usr/local/etc/php-fpm.d/www_overrides.conf

.lando/php-fpm.conf

; Override default PHP-FPM settings.
[www]

pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500

`lando drupal` broken due to upstream issue/breaking changes

Per hechoendrupal/drupal-console#4262, there appears to be an issue with the installer (https://drupalconsole.com/installer) being unavailable. This is causing lando drupal to throw /usr/local/bin/drupal: 2: /usr/local/bin/drupal: Syntax error: redirection unexpected since the 500 page contents are being downloaded instead of the installer itself.

In that issue, the maintainer noted that

We are working to solve this but in future versions this installer will be removed.

Please use the composer require drupal/console to install DC

As such, it might be a good idea to figure out how to remove the dependency on the installer itself. Somebody in the ticket noted that a dirty workaround is to grab a copy of the drupal executable from elsewhere (an env that still/already has it) and use that directly. So, something like adding that executable to a known url and grabbing it from there instead.

In either case, lando drupal is broken until the installer issue is handled.

Unhandled rejection Error: Cannot find module 'semver'

after I did lando --clear
in every command im facing with
Unhandled rejection Error: Cannot find module 'semver'
Require stack:

  • /home/blackwhaledev/.lando/plugins/@lando/php/services/php/builder.js
  • /snapshot/cli/lib/lando.js
  • /snapshot/cli/bin/lando.js
  1. If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1776:46)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Module.require (pkg/prelude/bootstrap.js:1676:31)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object. (/home/blackwhaledev/.lando/plugins/@lando/php/services/php/builder.js:6:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Module._compile (pkg/prelude/bootstrap.js:1715:32)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Module.require (pkg/prelude/bootstrap.js:1676:31)
    at require (internal/modules/cjs/helpers.js:92:18)
    at /snapshot/cli/lib/lando.js
    at arrayMap (/snapshot/cli/node_modules/lodash/lodash.js:653:23)
    at Function.map (/snapshot/cli/node_modules/lodash/lodash.js:9622:14)
    at interceptor (/snapshot/cli/node_modules/lodash/lodash.js:17094:35)
    at thru (/snapshot/cli/node_modules/lodash/lodash.js:8859:14)
    at /snapshot/cli/node_modules/lodash/lodash.js:4430:28
    at arrayReduce (/snapshot/cli/node_modules/lodash/lodash.js:697:21)
    From previous event:
    at /snapshot/cli/lib/lando.js
    From previous event:
    at Lando.bootstrap (/snapshot/cli/lib/lando.js)
    at Object. (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1751:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.runMain (pkg/prelude/bootstrap.js:1804:12)
    at internal/main/run_main_module.js:17:47

Error during download of composer when building WordPress recipe

Given the following .lando.yml

name: project_name
recipe: wordpress
config:
  webroot: 'www/htdocs'
  php: '8.2'
services:
  memcached:
    type: memcached

During project start i get the following error when starting appserver container:

PHP Parse error:  syntax error, unexpected token "::", expecting variable in /tmp/composer-setup.php on line 1341

Parse error: syntax error, unexpected token "::", expecting variable in /tmp/composer-setup.php on line 1341
ERROR ==>  

I found the following error at the row 1341 of the file composer-setup.php inside the class HttpClient

[...]
class HttpClient {

    /** @var null|string */
    private static self::$caPath; // maybe it has to be: private static $caPath;
[...]

I get the same error if i start with php: '8.1'

Add PHP 8.3 support

Soon a new version of PHP will be released. Although, it is not yet stable but it would be good to add a possibility to use that in Lando even before a stable release.

Until that, we have to use a custom Docker image. Here's what we've been using recently to test out webapps and Drupal sites manually under PHP 8.3 RC4 with Apache + with working xdebug (also using xdebug mode toggle script from lando/lando#1668 (comment)):

.lando.yml

name: drupal1083
recipe: drupal10
config:
  webroot: web
  php: '8.2' # Fake the version to prevent Lando errors but the correct version will be set in a custom image.
  database: mysql:8.0
  xdebug: off
  composer_version: '2'
  config:
    php: .lando/php.ini

services:
  appserver:
    scanner: false
    overrides:
      image: 'custom/php:8.3.0RC4-apache-bullseye'
      build: ./.lando/php
      environment:
        # Support debugging Drush with XDEBUG.
        PHP_IDE_CONFIG: "serverName=appserver"
        XDEBUG_MODE:

  database:
    creds:
      user: drupal1083
      password: drupal1083
      database: drupal1083

  phpmyadmin:
    scanner: false
    type: phpmyadmin:5.1
    hosts:
      - database

proxy:
  appserver:
    - drupal1083.localhost
  phpmyadmin:
    - pma.drupal1083.localhost

tooling:
  xdebug:
    description: Loads Xdebug in the selected mode.
    cmd:
      - appserver: /app/.lando/xdebug.sh
    user: root

.lando/php/Dockerfile

# docker build -t custom/php:8.3.0RC4-apache-bullseye .

FROM php:8.3.0RC4-apache-bullseye

# Install dependencies we need
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
  && apt -y update && apt-get install -y \
    gnupg2 \
    wget \
  && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/pgdg.list \
  && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
  && apt-get update && apt-get install -y \
    bzip2 \
    default-mysql-client \
    exiftool \
    git-core \
    imagemagick \
    libbz2-dev \
    libc-client-dev \
    libfreetype6-dev \
    libicu-dev \
    libjpeg62-turbo-dev \
    libkrb5-dev \
    libldap2-dev \
    libmagickwand-dev \
    libmemcached-dev \
    libpng-dev \
    libpq-dev \
    libssl-dev \
    libwebp-dev \
    libxml2-dev \
    libzip-dev \
    libonig-dev \
    openssl \
    postgresql-client-10 \
    pv \
    rsync \
    ssh \
    unzip \
    wget \
    xfonts-75dpi \
    xfonts-base \
    zlib1g-dev

RUN pecl install apcu \
  && pecl install imagick \
  && pecl install memcached \
  && pecl install oauth \
  && pecl install redis-5.3.7 \
#  && pecl install xdebug \
  && docker-php-ext-configure ldap --with-libdir=lib/$(uname -m)-linux-gnu/ \
  && docker-php-ext-enable apcu \
  && docker-php-ext-enable imagick \
  && docker-php-ext-enable memcached \
  && docker-php-ext-enable oauth \
  && docker-php-ext-enable redis \
  && docker-php-ext-install bcmath \
  && docker-php-ext-install bz2 \
  && docker-php-ext-install calendar \
  && docker-php-ext-install exif \
  && docker-php-ext-install gettext \
  && docker-php-ext-install intl \
  && docker-php-ext-install ldap \
  && docker-php-ext-install mbstring \
  && docker-php-ext-install mysqli \
  && docker-php-ext-install opcache \
  && docker-php-ext-install pcntl \
  && docker-php-ext-install pdo \
  && docker-php-ext-install pdo_mysql \
  && docker-php-ext-install pdo_pgsql \
  && docker-php-ext-install soap \
  && docker-php-ext-install zip \
  && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
  && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.18 \
  && php -r "unlink('composer-setup.php');" \
  && chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
  && apt-get -y clean \
  && apt-get -y autoclean \
  && apt-get -y autoremove \
  && rm -rf /var/lib/apt/lists/* && rm -rf && rm -rf /var/lib/cache/* && rm -rf /var/lib/log/* && rm -rf /tmp/* \
  && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
  && docker-php-ext-install imap \
  && docker-php-ext-configure gd --enable-gd --with-jpeg --with-webp --with-freetype \
  && docker-php-ext-install gd

# While there's no xdebug release for PHP 8.3, we need to install it from source.
# As soon as we can install with PECL, remove this RUN and uncomment the previous 
# pecl install xdebug line.
RUN apt-get install -y git \
    && git clone https://github.com/xdebug/xdebug.git \
    && cd xdebug \
    && phpize \
    && ./configure \
    && make \
    && make install \
    && cd .. \
    && docker-php-ext-enable xdebug

RUN curl https://dl.yarnpkg.com

.lando/php.ini

memory_limit = 256M

; Xdebug settings required for PhpStorm.
; https://github.com/lando/lando/issues/1668#issuecomment-772829423
xdebug.start_with_request = yes
xdebug.log_level=0

.lando/xdebug.sh

#!/bin/bash

if [ "$#" -ne 1 ]; then
  echo "Xdebug has been turned off, please use the following syntax: 'lando xdebug <mode>'."
  echo "Valid modes: https://xdebug.org/docs/all_settings#mode."
  echo xdebug.mode = off > /usr/local/etc/php/conf.d/zzz-lando-xdebug.ini
  /etc/init.d/apache2 reload
else
  mode="$1"
  echo xdebug.mode = "$mode" > /usr/local/etc/php/conf.d/zzz-lando-xdebug.ini
  /etc/init.d/apache2 reload
  echo "Xdebug is loaded in "$mode" mode."
fi

Outdated Mariadb client is incompatible with database dumps from newer mariadb versions

Related to lando/mariadb#55

Database dumps produced by recent versions of mariadb contain a new enable the sandbox mode command that cannot be processed by older versions of the mariadb client. This is fine for lando db-import because that script is run using the database container which will have the most recent patch version of mariadb client. However, when running scripts or commands such as drush in the PHP container, the version that ships with the PHP container is used. Currently, that's 10.5.23, which is the latest stable version from the debian 11 package repo. We need 10.5.25 to get support for new database dumps.

Bumping to debian 12 in #119 will take us up to 10.11.6, but support for the new command was added in 10.11.8.

So, if we want to allow drush or other scripts in the PHP container to work with data from up-to-date mariadb servers, we need to depart from the debian stable repo for installing mariadb client. I think it's fair for users to expect this to work and I think Lando should handle it.

I think we should install mariadb client package 10.11.8 (or latest patch version that matches each PHP image) directly from the mariadb repo during the image build.

Configure PHPStorm to run Drupal PHPUnit functional tests (linux host)

I want to be able to run Drupal tests within PHPStorm, but have not been able to configure it correctly. Unit and Kernel tests will run, but Functional tests are running into issues like file permissions or accessing urls.

I configured a CLI interpreter to use docker compose and included all configuration files in ~/.lando/compose/SITE, selecting appserver as the service.

When run is selected, it's giving file permission errors:

Exception : User warning: mkdir(): Permission Denied
Drupal\Component\PhpStorage\FileStorage->createDirectory()() (Line: 123)

When exec is selected:
the input device is not a TTY

If I create a CLI interpreter using the docker image, I get:
Behat\Mink\Exception\ElementNotFoundException : Button with id|name|label|value "Log in" not found.
This seems like it's not getting the right page at the configured url, http://appserver

Is there another way to get PHPUnit working in PHPStorm?

Lando + PHPStorm + PHPUnit

Hi there,

Has anyone successfully set up Lando + PHPStorm + PHPUnit to run all together, such that you can run the tests right from the IDE (Not the terminal/running as lando phpunit)? If so, can you post documentation on getting them set up? I've tried a few times and every time I believe it boils down to PHPStorm running some sort of containers of their own. But it IS possible through docker-compose (non lando setup), so am wondering if there are any tips/tricks to maybe getting it to work with Lando.

Much appreciated!

Lando v3.20.8 - ERROR ==> php version 8.1.22 is not supported

Hi, I have Lando v3.20.8 installed in local environment. This is for a Durpal 10 project and I am trying to get PHP 8.1.22 installed.

Here is my .lando.yml file

name: test
recipe: drupal9
config:
  via: apache
  webroot: web
  php: 8.1.22
  xdebug: true
  conf:
    mysql: lando/config/my.cnf
    php: lando/config/php.ini

proxy:
  drupal-solr:
    - search.test.lndo.site:8983
  pma:
    - pma.test.lndo.site
  mailhog:
    - mail.test.lndo.site

services:
  drupal-solr:
    type: solr:8.4
    portforward: true
    core: collection1
    config:
      dir: solr-conf
  pma:
    type: phpmyadmin
    hosts:
      - database
  appserver:
    composer:
      phpunit/phpunit: 8
      behat/behat: 3.3.1
    run:
      - "ln -s /usr/local/bin/composer /usr/local/bin/composer.phar"
    run_as_root:
      - "bash /app/lando/scripts/build.sh"
    overrides:
      environment:
        PHP_IDE_CONFIG: "serverName=appserver"
        LANDO_HOST_IP: "host.docker.internal"
        DRUSH_OPTIONS_URI: "http://test.lndo.site"
  mailhog:
    type: mailhog
    hogfrom:
      - appserver

tooling:
  composer:
    service: appserver
    description: run composer commands
    cmd: /usr/local/bin/composer
  drush:
    service: appserver
    description: run drush commands
    cmd: /app/vendor/drush/drush/drush
  phpunit:
    service: appserver
    description: run PHPUnit- use lando phpunit
  behat:
    service: appserver
    description: run behat- use lando behat
    cmd: cd /app ; behat  # Run behat from the /app  directory
  mailhog:
    service: mailhog

when doing lando rebuild, I get the following error:- ERROR ==> php version 8.1.22 is not supported

If I change the file to have php: 8.1 then it installs PHP 8.1.18

For my project; however, I need to have PHP 8.1.22 installed. Any help is appreciated.

Add Imagick to PHP 8.3

Due to an incompatibility issue with Imagick and PHP 8.3, the Imagick extensions is deliberately not included in the 8.3 image. The upstream issue can be tracked at Imagick/imagick#640.

Once the bug in imagick is fixed, we should get it added in.

Note that the matrix in extensions.md and the note below the matrix should be updated to reflect this change when it does occur.

composer show --no-dev --direct --name-only | xargs trims first letter of each package when there is a .lando.yml

I came across this by accident but this is the behaviour I'm getting.

➜  dev-ef2-drupal-installer git:(master) ✗ ls -la
total 880
drwxr-xr-x@ 14 tolgaozses  staff     448  8 Mar 20:47 .
drwxr-xr-x@ 21 tolgaozses  staff     672  8 Mar 20:36 ..
-rw-r--r--   1 tolgaozses  staff     357  8 Mar 20:40 .editorconfig
drwxr-xr-x@ 12 tolgaozses  staff     384  8 Mar 20:36 .git
-rw-r--r--   1 tolgaozses  staff    4034  8 Mar 20:40 .gitattributes
-rw-r--r--@  1 tolgaozses  staff    1355  8 Mar 20:40 .gitignore
-rw-r--r--@  1 tolgaozses  staff     405  8 Mar 20:38 .lando.yml
-rw-r--r--@  1 tolgaozses  staff    7595  8 Mar 20:39 composer.json
-rw-r--r--   1 tolgaozses  staff  419831  8 Mar 20:39 composer.lock
-rw-r--r--@  1 tolgaozses  staff     321  8 Mar 20:36 load.environment.php
drwxr-xr-x@  3 tolgaozses  staff      96  8 Mar 20:36 patches
drwxr-xr-x@  3 tolgaozses  staff      96  8 Mar 20:36 scripts
drwxr-xr-x  42 tolgaozses  staff    1344  8 Mar 20:40 vendor
drwxr-xr-x@ 22 tolgaozses  staff     704  8 Mar 20:40 web
➜  dev-ef2-drupal-installer git:(master) ✗ composer show --no-dev --direct --name-only|xargs
omposer/installers weagans/composer-patches rupal/admin_toolbar rupal/antibot rupal/background_image_formatter rupal/better_exposed_filters rupal/blockgroup rupal/cacheflush rupal/clientside_validation rupal/core-composer-scaffold rupal/core-project-message rupal/core-recommended rupal/crop rupal/ctools rupal/devel rupal/ds rupal/easy_breadcrumb rupal/editor_advanced_link rupal/entity_clone rupal/entity_reference_revisions rupal/eu_cookie_compliance rupal/field_group rupal/fixed_block_content rupal/focal_point rupal/gin rupal/gin_login rupal/imce rupal/ip_anon rupal/link_class rupal/linkit rupal/mailsystem rupal/masquerade rupal/menu_block rupal/menu_link_attributes rupal/metatag rupal/mimemail rupal/paragraphs rupal/paragraphs_asymmetric_translation_widgets rupal/pathauto rupal/rabbit_hole rupal/redirect rupal/restui rupal/robots_dtap rupal/schema_metatag rupal/search_api rupal/simple_sitemap rupal/svg_image rupal/token rupal/twig_tweak rupal/video_embed_field rupal/views_infinite_scroll rupal/views_row_insert rupal/vitals rupal/webform rupal/yoast_seo rush/drush f2/ef2_admin f2/ef2_drupal_installation_profile lluminate/collections aravel/helpers lucas/phpdotenv
➜  dev-ef2-drupal-installer git:(master) ✗ mv .lando.yml ~
➜  dev-ef2-drupal-installer git:(master) ✗ composer show --no-dev --direct --name-only|xargs
composer/installers cweagans/composer-patches drupal/admin_toolbar drupal/antibot drupal/background_image_formatter drupal/better_exposed_filters drupal/blockgroup drupal/cacheflush drupal/clientside_validation drupal/core-composer-scaffold drupal/core-project-message drupal/core-recommended drupal/crop drupal/ctools drupal/devel drupal/ds drupal/easy_breadcrumb drupal/editor_advanced_link drupal/entity_clone drupal/entity_reference_revisions drupal/eu_cookie_compliance drupal/field_group drupal/fixed_block_content drupal/focal_point drupal/gin drupal/gin_login drupal/imce drupal/ip_anon drupal/link_class drupal/linkit drupal/mailsystem drupal/masquerade drupal/menu_block drupal/menu_link_attributes drupal/metatag drupal/mimemail drupal/paragraphs drupal/paragraphs_asymmetric_translation_widgets drupal/pathauto drupal/rabbit_hole drupal/redirect drupal/restui drupal/robots_dtap drupal/schema_metatag drupal/search_api drupal/simple_sitemap drupal/svg_image drupal/token drupal/twig_tweak drupal/video_embed_field drupal/views_infinite_scroll drupal/views_row_insert drupal/vitals drupal/webform drupal/yoast_seo drush/drush ef2/ef2_admin ef2/ef2_drupal_installation_profile illuminate/collections laravel/helpers vlucas/phpdotenv
➜  dev-ef2-drupal-installer git:(master) ✗ ls -la
total 872
drwxr-xr-x@ 13 tolgaozses  staff     416  8 Mar 20:49 .
drwxr-xr-x@ 21 tolgaozses  staff     672  8 Mar 20:36 ..
-rw-r--r--   1 tolgaozses  staff     357  8 Mar 20:40 .editorconfig
drwxr-xr-x@ 12 tolgaozses  staff     384  8 Mar 20:36 .git
-rw-r--r--   1 tolgaozses  staff    4034  8 Mar 20:40 .gitattributes
-rw-r--r--@  1 tolgaozses  staff    1355  8 Mar 20:40 .gitignore
-rw-r--r--@  1 tolgaozses  staff    7595  8 Mar 20:39 composer.json
-rw-r--r--   1 tolgaozses  staff  419831  8 Mar 20:39 composer.lock
-rw-r--r--@  1 tolgaozses  staff     321  8 Mar 20:36 load.environment.php
drwxr-xr-x@  3 tolgaozses  staff      96  8 Mar 20:36 patches
drwxr-xr-x@  3 tolgaozses  staff      96  8 Mar 20:36 scripts
drwxr-xr-x  42 tolgaozses  staff    1344  8 Mar 20:40 vendor
drwxr-xr-x@ 22 tolgaozses  staff     704  8 Mar 20:40 web

I'm on macOS Sonoma 14.3.1 with zsh. I'm also using oh-my-zsh if it helps. Composer is on the host and version is 2.7.1

Xdebug does not work on M1 Mac

I cannot get Xdebug to work on an M1 Mac. The same configuration works without any issues on an Intel Mac running the same version of macOS, 12.0.1.

This can be reproduced by starting a new environment with the default wordpress or drupal9 recipes and adding xdebug: true to .lando.yml. I have confirmed that xdebug is active, but my debugger cannot connect. If I specify a custom php.ini file that enables xdebug logging, i see:

[208] [Step Debug] INFO: Checking remote connect back address.
[208] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
[208] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 172.20.0.1:9003.
[208] [Step Debug] WARN: Creating socket for '172.20.0.1:9003', poll success, but error: Operation now in progress (29).
[208] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: host.docker.internal:9003. :-|
[208] [Step Debug] WARN: Creating socket for 'host.docker.internal:9003', getaddrinfo: Invalid argument.
[208] [Step Debug] ERR: Could not connect to debugging client. Tried: 172.20.0.1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(

I've also tried reverting to xdebug 2 and the same issues occur.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.