9Cells

Laravel Homestead 업데이트

laravel new 명령이 기본적으로 Laravel이 9를 설치하기 시작했다.

Laravel 9은 최소 php81을 요구한다.

사용 중인 Laravel Homestead에서 php80 최신이라 laravel new 명령이 에러가 난다.

Homestead를 업데이트 해보자.

cd C:\Users\m********\Homestead
vagrant destroy # 기존 삭제
vagrant box update # 완료에 한 5분 걸림...
init.bat # 실행하면 몇 개 파일을 생성하는데 Homestead.yaml 덮어쓸지 주의해서 선택
vagrant up # 아래와 같은 에러 발생
# ==> homestead: Setting the name of the VM: homestead
# The name of your virtual machine couldn't be set because VirtualBox
# is reporting another VM with that name already exists. Most of the
# time, this is because of an error with VirtualBox not cleaning up
# properly. To fix this, verify that no VMs with that name do exist
# (by opening the VirtualBox GUI). If they don't, then look at the
# folder in the error message from VirtualBox below and remove it
# if there isn't any information you need in there.

# Rename A -> B 에서 에러가 났는데 VirtualBox 띄워서 A이름이 들어간 이미지를 지우고
# B 이름의 디렉토리를 지우고
# 다시 vagrant up 성공

위와같이 진행하였고 mysql에서 db가 지워진 상태였기 때문에 artisan migrate를 시도했다.

여기서 에러가 발생했고 composer update 후에 다시 migrate를 실행하니 잘 된다.

문제해결

MySQL Workbench 연결 실패 해결하기

Homestead 업데이트 후 MySQL workbench 연결 실패. Homestead.yaml에 다음을 추가했더니 해결 됨.

ports:
    - send: 33060
      to: 3306