- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法让更新的 Homestead 与 php 5.6 一起用于我的一个项目。我销毁了我的旧机器并删除了 ~/Homestead
文件夹,重新克隆它并在 v7.3.0 上 checkout 。我也在使用最新版本的 laravel/homestead box。但是,在运行我的 php 5.6 项目代码时,我仍然遇到与 php 版本不匹配相关的错误。倾销 phpinfo 给了我 PHP Version 7.2.3-1+ubuntu16.04.1+deb.sury.org+1
.
在这一点上我真的卡住了,为什么我的 php 5.6 项目仍然使用 php 7.2?
您可以在下面找到我的 Homestead.yaml
文件,以及启动 homestead-7
后的终端输出机器。
---
ip: "192.168.10.10"
memory: 3072
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/coding/php56project
to: /home/vagrant/php56project
php: "5.6"
- map: ~/coding/php72project
to: /home/vagrant/php72project
sites:
- map: php56project.test
to: /home/vagrant/php56project/public
- map: php72project.test
to: /home/vagrant/php72project/public
databases:
- homestead
- php56project
- php72project
myself@mypc:~/Homestead$ homestead up
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: 4040 (guest) => 4040 (host) (adapter 1)
homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
homestead-7: 8025 (guest) => 8025 (host) (adapter 1)
homestead-7: 27017 (guest) => 27017 (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:
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!
==> homestead-7: Checking for guest additions in VM...
homestead-7: The guest additions on this VM do not match the installed version of
homestead-7: VirtualBox! In most cases this is fine, but in rare cases it can
homestead-7: prevent things such as shared folders from working properly. If you see
homestead-7: shared folder errors, please make sure the guest additions within the
homestead-7: virtual machine match the version of VirtualBox you have installed on
homestead-7: your host and reload your VM.
homestead-7:
homestead-7: Guest Additions Version: 5.0.18_Ubuntu r106667
homestead-7: VirtualBox Version: 5.2
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Mounting shared folders...
homestead-7: /vagrant => /home/myself/Homestead
homestead-7: /home/vagrant/php72project => /home/myself/coding/php72project
homestead-7: /home/vagrant/php56project => /home/myself/coding/php56project
==> homestead-7: Running provisioner: file...
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
homestead-7:
homestead-7: ssh-rsa AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmyemail@provider.com
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: /tmp/vagrant-shell20180406-3138-1u0i9xy.sh
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Certificate: php56project.test
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Site: php56project.test
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Checking for old Schedule
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Certificate: php72project.test
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Site: php72project.test
==> homestead-7: Running provisioner: shell...
homestead-7: Running: inline script
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Checking for old Schedule
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Clear Variables
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Restarting Cron
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Restarting Nginx
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating MySQL Database: homestead
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Postgres Database: homestead
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating MySQL Database: php56project
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Postgres Database: php56project
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating MySQL Database: php72project
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Creating Postgres Database: php72project
==> homestead-7: Running provisioner: shell...
homestead-7: Running: script: Update Composer
homestead-7: You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
homestead-7: You are already using composer version 1.6.3 (stable channel).
==> homestead-7: Running provisioner: shell...
homestead-7: Running: /tmp/vagrant-shell20180406-3138-t73ng.sh
==> homestead-7: Running provisioner: shell...
homestead-7: Running: /tmp/vagrant-shell20180406-3138-1q4bwqp.sh
最佳答案
在 Vagrant VM 中全局运行的 PHP 版本与为每个站点运行的 PHP 版本之间存在差异,后者在 nginx 级别进行控制。
在创建 VM 的过程中,Homestead 使用脚本 serve-laravel.sh
为每个 Laravel 站点配置自定义 nginx 设置。 :
location ~ \.php$ {
...
# After compilation e.g.: fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_pass unix:/var/run/php/php$5-fpm.sock; // e.g. $5 = '5.6'
...
}
$5
是存储您的站点将使用的 php 版本的变量。例如“7.1”或“5.6”。
/etc/nginx/sites-enabled/php56project.test
处的 nginx 设置你可以确认
php5.6-fpm.sock
正在使用。
关于php - Homestead 7 yaml php 5.6 仍在运行 7.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49698679/
是否可以在 yaml 中存储未转义的 Markdown 文档?我测试过 key:|+ markdown text block that could have any combination o
在解析使用两个空格缩进创建的 YAML(使用 Ruby 2.5/Psych)时,我看到了奇怪的行为。同一个文件,每行缩进四个空格 - 在我看来 - 正如预期的那样。 两个空格: windows:
如何在 yaml 文件中使用三元运算符让 snakeparser 解析它 我使用 groovy 来解析表达式,!e 标签帮助我这样做。现在,当我使用三元运算符时,解析器会失败。 name : abc
是否可以有这样的多行键? mykey: - > key one: keytwo: val 其中 keyone 被视为一个键。我想解析 yaml 以产生: { mykey:
我有一个 YAML 文件,它有几个不同的键,我想为其提供相同的值。此外,我希望该值易于配置。 请参阅下面的 YAML 以了解我的特定用例: --- # Options for attribute_va
在 Perl 中,我可以执行以下操作: my $home = "/home"; my $alice = "$home/alice"; 我可以在 YAML 中执行以下操作: Home: /home Al
如何在 YAML 中表示空字典? IE。它在语义上应该等同于空的 json-object {}。 最佳答案 简短回答:使用 {} 在 yaml 中有两种表示映射(字典)的方法; flow mappin
我需要根据 if 条件再添加一个名称。如果另一个 .yml 文件中的变量值为“yes”,则在列表中添加新名称 我的 yaml 文件中有以下代码: JsNames: - name: 'jquery.m
我是 yaml 新手,我对用于多行的管道符号 (|) 有疑问。 YAML 是否有类似下面的语法? test: |6+ 在下面的两个 YAML 文件中,第一个有效,第二个无效。我不知道是什么原因造成的。
关于 YAML specs关于问号有2.11段: A question mark and space (“? ”) indicate a complex mapping key. Within a b
1。摘要 我找不到如何自动美化我的 YAML 文件。 2。数据 示例: 我有 SashaPrettifyYAML.yaml 文件: sasha_commands: # Sasha comm
我试图理解 YAML 的基本概念。我没有找到任何相关文档可以消除我的疑虑。例如: product: - sku : BL394D quantity : 4
1。摘要 我找不到如何自动美化我的 YAML 文件。 2。数据 示例: 我有 SashaPrettifyYAML.yaml 文件: sasha_commands: # Sasha comm
是否有在 YAML 键中使用空格的正确方法?喜欢 a test: "hello world!" 或 "a test": "hello world!" 或者这只是一个坏主意,应该使用 a_test: "
我在 YAML 中遇到这个问题通过 perl 使用时。谁能告诉我哪里出了问题。 我有一个代码片段 use YAML; ... my $ifdef_struct = YAML::Load(': unde
我有一系列 OpenCv 生成的 YAML 文件,想用 yaml-cpp 解析它们 我在简单的事情上做得很好,但矩阵表示很困难。 # Center of table tableCenter: !!op
有没有办法在启动文件期间加载的 ROS yaml 文件中使用环境变量? 例如, 测试启动: 例子.yaml: vehicle_name: "${VEHICLE_NAME}_robot
Pandoc 支持 YAML metadata block在 Markdown 文档中。这可以设置标题和作者等。它还可以通过更改字体大小、边距宽度和赋予包含的图形的框架大小来操纵 PDF 输出的外观。
我使用当前(2013/12/12)最新版本的 yaml-cpp。 我注意到 YAML::Load("")和 YAML::Load("---\n...") 导致 Null 节点,即 YAML::Load
我喜欢 YAML。 等等,让我备份。我喜欢看起来像这样的 YAML,甚至比 JSON 还要多: Projects: C/C++ Libraries: - libyaml # "C"
我是一名优秀的程序员,十分优秀!