简体   繁体   中英

How can I create a laravel project with latest php version?

I have two PHP version(php 5.6 & php 7.3) installed in my xampp. I have two folders for these two version.

  • php
  • php73

php7.3 runs on port 8081 and php 5.6 runs on Port 8080.

I have installed composer for the php 5.6 version.

Now when I try to install latest laravel project using

laravel new project_name 

OR

composer create-project --prefer-dist laravel/laravel project_name

it installs the the previous version of php.

How can create a new laravel project with new php version?

On Windows: You need to set your environment variables to the PHP binary you would like. Go into System Properties -> Environment Variables (on the Advanced tab at the bottom). There you should have a variable called 'Path'. Edit it and then look for the one that points to the 5.6 PHP binary (most probably, this is the case). Modify that to point to the PHP binary of your choice (7.3).

You can then open a new cmd and type php -v. It should say 7.3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM