今天我想从头开始安装php7。我看了一些教程,现在我的 vagrantfile 看起来像:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network :forwarded_port, guest: 80, host: 4567
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
end
bootstrap.sh:
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant /var/www
fi
apt-get update
apt-get install -y make
apt-get install -y php-pear
apt-get install -y git-core
apt-get install -y autoconf
apt-get install -y bison
apt-get install -y libxml2-dev
apt-get install -y libbz2-dev
apt-get install -y libmcrypt-dev
apt-get install -y libcurl4-openssl-dev
apt-get install -y libltdl-dev
apt-get install -y libpng-dev
apt-get install -y libpspell-dev
apt-get install -y libreadline-dev
apt-get install -y libssl-dev
apt-get install -y install libt1-dev
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
cd /tmp
git clone https://github.com/php/php-src.git --depth=1
cd php-src
./buildconf
./configure \
--prefix=/usr/local/php7 \
--enable-bcmath --with-bz2 \
--enable-calendar \
--enable-exif \
--enable-dba \
--enable-ftp \
--with-gettext \
--with-gd \
--enable-mbstring \
--with-mcrypt \
--with-mhash \
--enable-mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--enable-pcntl \
--with-pspell \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-zlib \
--enable-zip \
--with-readline \
--with-curl \
--with-config-file-path=/etc/php7/cli \
--with-config-file-scan-dir=/etc/php7/cli/conf.d
make
make test
make install
我使用 vagrant 版本 1.7.4 和 virtual box 版本 5.0.10。
我在编译过程中遇到错误。我做错了什么?