gpt4 book ai didi

php - vagrant up 后出错

转载 作者:太空宇宙 更新时间:2023-11-04 10:37:23 25 4
gpt4 key购买 nike

我的 Vagrantfile 配置如此,如果我执行“vagrant up”,它会运行一个配置脚本来安装我想要的所有包。这正是我正在做的,但在执行“vagrant up”(第一次)后出现错误这是错误: enter image description here

这是我的 provisions.sh 代码:

#!/usr/bin/env bash

PROJECT="foundation"
PROJECT_LOG="foundation"

MYSQL_PASSWORD="password"

set -o nounset -o errexit -o pipefail -o errtrace

error() {
local sourcefile=$1
local lineno=$2
echo "ERROR at ${sourcefile}:${lineno}; Last logs:"
grep "${PROJECT}" /var/log/syslog | tail -n 20
}

trap 'error "${BASH_SOURCE}" "${LINENO}"' ERR

oe() { "$@" 2>&1 | logger -t "${PROJECT}" > /dev/null; }
ol() { echo "[${PROJECT_LOG}] $@"; }

export DEBIAN_FRONTEND=noninteractive

ol 'Updating repository caches'
oe sudo apt-get -q -y update

ol 'Adding apt repositories'
oe sudo apt-get -q -y install python-software-properties
oe sudo add-apt-repository ppa:ondrej/php5-5.6

ol 'Updating repository caches (second time)'
oe sudo apt-get -q -y update

ol "Installing misc packages"
oe sudo apt-get -q -y install language-pack-nl

ol 'Installing Apache 2'
oe sudo apt-get -q -y install apache2
oe sudo systemctl restart apache2
oe sudo systemctl status apache2

ol "Installing PHP"
oe sudo apt-get -q -y install php5 libapache2-mod-php5 \\
php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick \\
php5-imap php5-mcrypt php5-memcached php5-ming php5-ps \\
php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy \\
php5-xmlrpc php5-xsl php5-xcache

ol 'Installing Sendmail'
oe sudo apt-get -q -y install sendmail

ol 'Restarting Apache 2'
oe sudo systemctl restart apache2
oe sudo systemctl status apache2

ol "Installing MySQL"
oe sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password ${MYSQL_PASSWORD}"
oe sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ${MYSQL_PASSWORD}"
oe sudo apt-get -q -y install mysql-server mysql-client
oe sudo systemctl restart mysql
oe sudo systemctl status mysql

最佳答案

它提示

==> default: Apr 22 01:06:22 vagrant-ubuntu-wily-64 foundation:  * Starting Apache httpd web server apache2
==> default: Apr 22 01:06:22 vagrant-ubuntu-wily-64 foundation: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

在您的 Vagrantfile 中,确保将主机名设置为完全限定的域,例如

config.vm.hostname = "dev.local"

应该使供应愉快。

其次它不喜欢你的 php 安装包中的 \\

你可以把所有的东西放在一行中,它会起作用

oe sudo apt-get -q -y install php5 libapache2-mod-php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache

它来自oe 方法但不确定如何处理它

关于php - vagrant up 后出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36787764/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com