Zend Framework Ändern SetEnv APPLICATION_ENV auf "Produktion" bewirkt, dass apache 500 error
Wenn ich APPLICATION_ENV auf "Produktion" und Neustart von apache bekomme ich einen 500 Fehler. Wenn es um die Entwicklung habe ich keine Probleme. Ich bin völlig angefressen. Irgendwelche Vorschläge? Config-Dateien sind unten
httpd-vhosts.conf
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
NameVirtualHost *:443
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile "C:\Program Files\Zend\Apache2\conf\ssl\star.crt"
SSLCertificateKeyFile "C:\Program Files\Zend\Apache2\conf\ssl\star.key"
ServerAdmin postmaster@dummy-host.localhost
DocumentRoot "C:\Sidekick\public"
ServerName *
ServerAlias *
<Directory "C:\Sidekick\public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
SetEnv APPLICATION_ENV development
</Directory>
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>
.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{DOCUMENT_ROOT}/cached/index.html -f
RewriteRule ^/*$ cached/index.html [L]
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{DOCUMENT_ROOT}/cached/%{REQUEST_URI}\.html -f
RewriteRule .* cached/%{REQUEST_URI}\.html [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
index.php
<?php
//Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
//Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
//Ensure library/is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
//Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
Du musst angemeldet sein, um einen Kommentar abzugeben.
Code sieht OK für mich und es wäre für einen nicht-'Produktion' Umgebung, ich würde davon ausgehen.
Ich würde mal in configs/application.ini, um sicherzustellen, Sie hatten einen [Produktion] - Abschnitt, mit oder ohne ': erweitert]' Teil. Auch, wickeln Sie das
bootstrap()->run();
in einem try/catch, und haben die Ausnahme generiert und angezeigt werden. mindestens, bis Sie haben gedebuggt dies.[dev : production]
haben die gleiche info, aber überschreiben, was erforderlich ist für dev.