kavo

Linux 下面板 aapanel 或者 lnmp 安装最新 laravel10

捣鼓了一天,都卡在 laravel 的composer 安装上面,各种报错,要不就是文件夹没有 vendor

还趁机学习了 composer 不少知识

无意间跑步时搜到内容说有可能时 php 版本问题以及扩展问题

瞬间明白,然后回来安装均成功

注意 Laravel 10 要求 php 至少为版本 8.1

一:lnmp 下安装的军哥的一键安装包

php 版本安装时选择的 PHP 8.1.7

安装后确认版本

[root@lnmp1.9]# php -v
PHP 8.1.7 (cli) (built: Apr  1 2023 10:55:58) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.7, Copyright (c) Zend Technologies

composer 默认安装版本为 2.5.5

[root@lnmp1.9]# composer -V
Composer version 2.5.5 2023-03-21 11:50:05

安装前记得将 php.ini 里的禁用函数 proc_open 和 proc_get_status 删除,然后重启 php

如果不删除否则会报以下错误

 然后直接安装最新版本的 laravel10 直接成功

composer create-project laravel/laravel example-app
[root@wwwroot]# composer create-project laravel/laravel example-app
Creating a "laravel/laravel" project at "./example-app"
Installing laravel/laravel (v10.0.5)
  - Installing laravel/laravel (v10.0.5): Extracting archive
Created project in /home/wwwroot/example-app
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 106 installs, 0 updates, 0 removals
  - Locking brick/math (0.10.2)
  - Locking dflydev/dot-access-data (v3.0.2)
  - Locking doctrine/inflector (2.0.6)
  - Locking doctrine/lexer (3.0.0)
  - Locking dragonmantank/cron-expression (v3.3.2)
  - Locking egulias/email-validator (4.0.1)
  - Locking fakerphp/faker (v1.21.0)
  - Locking filp/whoops (2.15.1)
  - Locking fruitcake/php-cors (v1.2.0)
  - Locking graham-campbell/result-type (v1.1.1)
  - Locking guzzlehttp/guzzle (7.5.0)
  - Locking guzzlehttp/promises (1.5.2)
  - Locking guzzlehttp/psr7 (2.4.4)
  - Locking guzzlehttp/uri-template (v1.0.1)
  - Locking hamcrest/hamcrest-php (v2.0.1)
  - Locking laravel/framework (v10.5.1)
  - Locking laravel/pint (v1.7.0)
  - Locking laravel/sail (v1.21.3)
  - Locking laravel/sanctum (v3.2.1)
  - Locking laravel/serializable-closure (v1.3.0)
  - Locking laravel/tinker (v2.8.1)
  - Locking league/commonmark (2.4.0)
  - Locking league/config (v1.2.0)
  - Locking league/flysystem (3.12.3)
  - Locking league/mime-type-detection (1.11.0)
  - Locking mockery/mockery (1.5.1)
  - Locking monolog/monolog (3.3.1)
  - Locking myclabs/deep-copy (1.11.1)
  - Locking nesbot/carbon (2.66.0)
  - Locking nette/schema (v1.2.3)
  - Locking nette/utils (v4.0.0)
  - Locking nikic/php-parser (v4.15.4)
  - Locking nunomaduro/collision (v7.4.0)
  - Locking nunomaduro/termwind (v1.15.1)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.2.1)
  - Locking phpoption/phpoption (1.9.1)
  - Locking phpunit/php-code-coverage (10.0.2)
  - Locking phpunit/php-file-iterator (4.0.1)
  - Locking phpunit/php-invoker (4.0.0)
  - Locking phpunit/php-text-template (3.0.0)
  - Locking phpunit/php-timer (6.0.0)
  - Locking phpunit/phpunit (10.0.19)
  - Locking psr/container (2.0.2)
  - Locking psr/event-dispatcher (1.0.0)
  - Locking psr/http-client (1.0.1)
  - Locking psr/http-factory (1.0.1)
  - Locking psr/http-message (1.0.1)
  - Locking psr/log (3.0.0)
  - Locking psr/simple-cache (3.0.0)
  - Locking psy/psysh (v0.11.14)
  - Locking ralouphie/getallheaders (3.0.3)
  - Locking ramsey/collection (2.0.0)
  - Locking ramsey/uuid (4.7.3)
  - Locking sebastian/cli-parser (2.0.0)
  - Locking sebastian/code-unit (2.0.0)
  - Locking sebastian/code-unit-reverse-lookup (3.0.0)
  - Locking sebastian/comparator (5.0.0)
  - Locking sebastian/complexity (3.0.0)
  - Locking sebastian/diff (5.0.1)
  - Locking sebastian/environment (6.0.0)
  - Locking sebastian/exporter (5.0.0)
  - Locking sebastian/global-state (6.0.0)
  - Locking sebastian/lines-of-code (2.0.0)
  - Locking sebastian/object-enumerator (5.0.0)
  - Locking sebastian/object-reflector (3.0.0)
  - Locking sebastian/recursion-context (5.0.0)
  - Locking sebastian/type (4.0.0)
  - Locking sebastian/version (4.0.1)
  - Locking spatie/backtrace (1.4.0)
  - Locking spatie/flare-client-php (1.3.5)
  - Locking spatie/ignition (1.4.5)
  - Locking spatie/laravel-ignition (2.0.0)
  - Locking symfony/console (v6.2.8)
  - Locking symfony/css-selector (v6.2.7)
  - Locking symfony/deprecation-contracts (v3.2.1)
  - Locking symfony/error-handler (v6.2.7)
  - Locking symfony/event-dispatcher (v6.2.8)
  - Locking symfony/event-dispatcher-contracts (v3.2.1)
  - Locking symfony/finder (v6.2.7)
  - Locking symfony/http-foundation (v6.2.8)
  - Locking symfony/http-kernel (v6.2.8)
  - Locking symfony/mailer (v6.2.8)
  - Locking symfony/mime (v6.2.7)
  - Locking symfony/polyfill-ctype (v1.27.0)
  - Locking symfony/polyfill-intl-grapheme (v1.27.0)
  - Locking symfony/polyfill-intl-idn (v1.27.0)
  - Locking symfony/polyfill-intl-normalizer (v1.27.0)
  - Locking symfony/polyfill-mbstring (v1.27.0)
  - Locking symfony/polyfill-php72 (v1.27.0)
  - Locking symfony/polyfill-php80 (v1.27.0)
  - Locking symfony/polyfill-uuid (v1.27.0)
  - Locking symfony/process (v6.2.8)
  - Locking symfony/routing (v6.2.8)
  - Locking symfony/service-contracts (v3.2.1)
  - Locking symfony/string (v6.2.8)
  - Locking symfony/translation (v6.2.8)
  - Locking symfony/translation-contracts (v3.2.1)
  - Locking symfony/uid (v6.2.7)
  - Locking symfony/var-dumper (v6.2.8)
  - Locking symfony/yaml (v6.2.7)
  - Locking theseer/tokenizer (1.2.1)
  - Locking tijsverkoyen/css-to-inline-styles (2.2.6)
  - Locking vlucas/phpdotenv (v5.5.0)
  - Locking voku/portable-ascii (2.0.1)
  - Locking webmozart/assert (1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 106 installs, 0 updates, 0 removals
  - Downloading doctrine/inflector (2.0.6)
  - Downloading doctrine/lexer (3.0.0)
  - Downloading symfony/polyfill-ctype (v1.27.0)
  - Downloading webmozart/assert (1.11.0)
  - Downloading dragonmantank/cron-expression (v3.3.2)
  - Downloading symfony/deprecation-contracts (v3.2.1)
  - Downloading psr/container (2.0.2)
  - Downloading fakerphp/faker (v1.21.0)
  - Downloading symfony/polyfill-mbstring (v1.27.0)
  - Downloading symfony/http-foundation (v6.2.8)
  - Downloading fruitcake/php-cors (v1.2.0)
  - Downloading psr/http-message (1.0.1)
  - Downloading psr/http-client (1.0.1)
  - Downloading ralouphie/getallheaders (3.0.3)
  - Downloading psr/http-factory (1.0.1)
  - Downloading guzzlehttp/psr7 (2.4.4)
  - Downloading guzzlehttp/promises (1.5.2)
  - Downloading guzzlehttp/guzzle (7.5.0)
  - Downloading symfony/polyfill-php80 (v1.27.0)
  - Downloading guzzlehttp/uri-template (v1.0.1)
  - Downloading laravel/pint (v1.7.0)
  - Downloading symfony/yaml (v6.2.7)
  - Downloading voku/portable-ascii (2.0.1)
  - Downloading phpoption/phpoption (1.9.1)
  - Downloading graham-campbell/result-type (v1.1.1)
  - Downloading vlucas/phpdotenv (v5.5.0)
  - Downloading symfony/css-selector (v6.2.7)
  - Downloading tijsverkoyen/css-to-inline-styles (2.2.6)
  - Downloading symfony/var-dumper (v6.2.8)
  - Downloading symfony/polyfill-uuid (v1.27.0)
  - Downloading symfony/uid (v6.2.7)
  - Downloading symfony/routing (v6.2.8)
  - Downloading symfony/process (v6.2.8)
  - Downloading symfony/polyfill-php72 (v1.27.0)
  - Downloading symfony/polyfill-intl-normalizer (v1.27.0)
  - Downloading symfony/polyfill-intl-idn (v1.

posted on 2023-04-01 13:14  下雨天唱情歌  阅读(34)  评论(0编辑  收藏  举报  来源

导航