我的流浪者没有显示任何错误500的响应

时间:2015-10-02 16:20:27

标签: php zend-framework2 vagrant

我是Vagrant的新手,我在使用ZendFramework 2升级我的Vagrant服务器时遇到了麻烦。下面是我的配置文件......

# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = '2'

@script = <<SCRIPT
DOCUMENT_ROOT_ZEND="/var/www/zf/public"
apt-get update
apt-get install -y apache2 git curl php5-cli php5 php5-intl libapache2-mod-php5
echo "
<VirtualHost *:80>
    ServerName skeleton-zf.local
    DocumentRoot $DOCUMENT_ROOT_ZEND
    <Directory $DOCUMENT_ROOT_ZEND>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
" > /etc/apache2/sites-available/skeleton-zf.conf
a2enmod rewrite
a2dissite 000-default
a2ensite skeleton-zf
service apache2 restart
cd /var/www/zf
curl -Ss https://getcomposer.org/installer | php
php composer.phar install --no-progress
echo "** [ZEND] Visit http://localhost:8085 in your browser for to view the application **"
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = 'bento/ubuntu-14.04'
  config.vm.network "forwarded_port", guest: 80, host: 8085
  config.vm.hostname = "skeleton-zf.local"
  config.vm.synced_folder '.', '/var/www/zf'
  config.vm.provision 'shell', inline: @script
  config.vm.network "private_network", ip: "0.0.0.0"

  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024"]
  end

end

当我尝试访问8085端口时,我得到一个带有HTTP代码500的空白页面,并且在我尝试访问的每个路径中,无论是否存在,我都得到了同样的错误。下面是我在Vagrant的php版本:

vagrant@skeleton-zf:~$ php -v
PHP 5.5.9-1ubuntu4.13 (cli) (built: Sep 29 2015 15:24:49) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
vagrant@skeleton-zf:~$ 

当我尝试在apache中运行任何命令时,我得到了这个:

vagrant@skeleton-zf:~$ apache2 -V
[Fri Oct 02 16:19:06.465441 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri Oct 02 16:19:06.466385 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Oct 02 16:19:06.466830 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Oct 02 16:19:06.469081 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Oct 02 16:19:06.469143 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Oct 02 16:19:06.474489 2015] [core:warn] [pid 5758] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

1 个答案:

答案 0 :(得分:0)

我的问题是隐藏的500错误消息,因为我没有安装php5-mysql包。配置没问题。