我已经在使用symfony 3,我已经用它创建了很多项目,所以现在我正在尝试用symfony 4创建一个项目,但是当我键入以下命令时我不能:>
composer create-project symfony/skeleton my-project-symf-4
项目创建成功,但是使用此版本3.4而不是4.2创建的问题
Installing symfony/skeleton (v3.4.22.1)
- Installing symfony/skeleton (v3.4.22.1): Downloading (100%)
Created project in my-project-symf-4
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 22 installs, 0 updates, 0 removals
- Installing symfony/flex (v1.1.8): Downloading (100%)
Prefetching 21 packages
- Downloading (100%)
- Installing psr/cache (1.0.1): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing symfony/polyfill-mbstring (v1.10.0): Loading from cache
- Installing psr/log (1.1.0): Loading from cache
- Installing symfony/debug (v3.4.22): Loading from cache
- Installing symfony/console (v3.4.22): Loading from cache
- Installing symfony/dotenv (v3.4.22): Loading from cache
- Installing symfony/routing (v3.4.22): Loading from cache
- Installing symfony/http-foundation (v3.4.22): Loading from cache
- Installing symfony/event-dispatcher (v3.4.22): Loading from cache
- Installing symfony/http-kernel (v3.4.22): Loading from cache
- Installing symfony/finder (v3.4.22): Loading from cache
- Installing symfony/filesystem (v3.4.22): Loading from cache
- Installing symfony/dependency-injection (v3.4.22): Loading from cache
- Installing symfony/config (v3.4.22): Loading from cache
- Installing symfony/class-loader (v3.4.22): Loading from cache
- Installing symfony/polyfill-apcu (v1.10.0): Loading from cache
- Installing symfony/cache (v3.4.22): Loading from cache
- Installing symfony/framework-bundle (v3.4.22): Loading from cache
- Installing symfony/yaml (v3.4.22): Loading from cache
Generating autoload files
因此您可以看到作曲家从缓存加载所有软件包。 我尝试像这样清除作曲家缓存:
$ composer clearcache
但没有结果,问题仍然存在。
我的PHP版本是7.3.1
有人可以帮助我解决该问题吗?
答案 0 :(得分:0)
尝试像这样通过symfony版本(例如4.2):
composer create-project symfony/skeleton:4.2 my-project-symf-4
希望这会有所帮助!
答案 1 :(得分:0)
如果您在系统中安装了symfony CLI,则只需运行以下命令并指定版本号即可
例如,创建一个4.4版本的Symfony项目,请按照以下命令运行
symfony new my_project_name --version = 4.4