PHP 版本设置为 7.0 而不是 Laravel Homestead-7 中的 >7.1
PHP version set to 7.0 instead of >7.1 in Laravel Homestead-7
自升级到 Laravel 5.6 后,我的网站不再使用 Homestead 呈现。我想,这是一个 PHP 版本问题。与 Laravel documentation 中的描述不同,我的服务器是 运行 而不是 PHP 7.2,而是 phpversion() 显示:
The current PHP version is 7.0.27-1+ubuntu16.04.1+deb.sury.org+1
将 php 选择器添加到我的 Homestead.yaml 文件没有任何效果。
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
php: "7.2"
我更新了整个环境,包括Virtual Box、Vagrant等。laravel/homestead安装的是5.1.0版本。如何将系统升级到 PHP 7.2?
我尝试使用 vagrant destroy && vagrant up 输出以下内容:
$ vagrant destroy && vagrant up
homestead-7: Are you sure you want to destroy the 'homestead-7' VM? [y/N]
==> homestead-7: Forcing shutdown of VM...
==> homestead-7: Destroying VM and associated drives...
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Setting the name of the VM: homestead-7
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
homestead-7: Adapter 1: nat
homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
homestead-7: 443 (guest) => 44300 (host) (adapter 1)
homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
homestead-7: SSH address: 127.0.0.1:2222
homestead-7: SSH username: vagrant
homestead-7: SSH auth method: private key
homestead-7: Warning: Connection reset. Retrying...
homestead-7: Warning: Connection aborted. Retrying...
(...)
homestead-7: Vagrant insecure key detected. Vagrant will automatically replace
homestead-7: this with a newly generated keypair for better security.
homestead-7:
homestead-7: Inserting generated public key within guest...
homestead-7: Removing insecure key from the guest if it's present...
homestead-7: Key inserted! Disconnecting and reconnecting using new SSH key...
==> homestead-7: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 5.2.4
Going on, assuming VBoxService is correct...
[homestead-7] GuestAdditions versions on your host (5.2.8) and guest (5.2.4) do not match.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 5.2.4
Going on, assuming VBoxService is correct...
Reading package lists...
Building dependency tree...
Reading state information...
dkms is already the newest version (2.2.0.3-2ubuntu11.5).
linux-headers-4.4.0-112-generic is already the newest version (4.4.0-112.135).
linux-headers-4.4.0-112-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso
into the box /tmp/VBoxGuestAdditions.iso
我不知道我的问题是否与 GuestAdditions 问题有关。然而,的解决方案并没有帮助。
感谢您的帮助!
vagrant destroy && vagrant up
如果它仍然没有使用 7.2 post 完整的输出,这样我们就可以看到可能出了什么问题。
那个问题是一个过时的 Homestead 版本。
克隆存储库并重新启动 vagrant 解决了它。
git clone https://github.com/laravel/homestead.git ~/Homestead
感谢您的帮助!
自升级到 Laravel 5.6 后,我的网站不再使用 Homestead 呈现。我想,这是一个 PHP 版本问题。与 Laravel documentation 中的描述不同,我的服务器是 运行 而不是 PHP 7.2,而是 phpversion() 显示:
The current PHP version is 7.0.27-1+ubuntu16.04.1+deb.sury.org+1
将 php 选择器添加到我的 Homestead.yaml 文件没有任何效果。
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
php: "7.2"
我更新了整个环境,包括Virtual Box、Vagrant等。laravel/homestead安装的是5.1.0版本。如何将系统升级到 PHP 7.2?
我尝试使用 vagrant destroy && vagrant up 输出以下内容:
$ vagrant destroy && vagrant up
homestead-7: Are you sure you want to destroy the 'homestead-7' VM? [y/N]
==> homestead-7: Forcing shutdown of VM...
==> homestead-7: Destroying VM and associated drives...
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Importing base box 'laravel/homestead'...
==> homestead-7: Matching MAC address for NAT networking...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Setting the name of the VM: homestead-7
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
homestead-7: Adapter 1: nat
homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
homestead-7: 443 (guest) => 44300 (host) (adapter 1)
homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
homestead-7: SSH address: 127.0.0.1:2222
homestead-7: SSH username: vagrant
homestead-7: SSH auth method: private key
homestead-7: Warning: Connection reset. Retrying...
homestead-7: Warning: Connection aborted. Retrying...
(...)
homestead-7: Vagrant insecure key detected. Vagrant will automatically replace
homestead-7: this with a newly generated keypair for better security.
homestead-7:
homestead-7: Inserting generated public key within guest...
homestead-7: Removing insecure key from the guest if it's present...
homestead-7: Key inserted! Disconnecting and reconnecting using new SSH key...
==> homestead-7: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 5.2.4
Going on, assuming VBoxService is correct...
[homestead-7] GuestAdditions versions on your host (5.2.8) and guest (5.2.4) do not match.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 5.2.4
Going on, assuming VBoxService is correct...
Reading package lists...
Building dependency tree...
Reading state information...
dkms is already the newest version (2.2.0.3-2ubuntu11.5).
linux-headers-4.4.0-112-generic is already the newest version (4.4.0-112.135).
linux-headers-4.4.0-112-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso
into the box /tmp/VBoxGuestAdditions.iso
我不知道我的问题是否与 GuestAdditions 问题有关。然而,
感谢您的帮助!
vagrant destroy && vagrant up
如果它仍然没有使用 7.2 post 完整的输出,这样我们就可以看到可能出了什么问题。
那个问题是一个过时的 Homestead 版本。 克隆存储库并重新启动 vagrant 解决了它。
git clone https://github.com/laravel/homestead.git ~/Homestead
感谢您的帮助!