lando / php

The Official Lando PHP plugin.
https://docs.lando.dev/php
GNU General Public License v3.0
16 stars 16 forks source link

php cli version is not updated! #63

Closed 0MAL closed 11 months ago

0MAL commented 1 year ago

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 ==> `

0MAL commented 1 year ago

lando destroy, rebooting computer and lando rebuild solved the issue, though this is not a right solution.

reynoldsalec commented 11 months ago

Hey @0MAL, just to check, were you running those commands within a container?

Using a stock D10 recipe I was able to run lando ssh and run php core/scripts/drupal generate-theme --help successfully, as well as lando php web/core/scripts/drupal generate-theme --help directly from my host.

reynoldsalec commented 11 months ago

Going to close this out for the moment @0MAL, definitely re-open if you need more help (and LMK if you have more details) or feel free to DM me on the Lando Slack.