@VoisHunter

Как запустить ZendFramework?

Не могу поднять проект после "смерти сервака"
Вылетает ошибка через WEB (You don't have permission to access /php-bin/php/index.php on this server.)

В логах (AH01630: client denied by server configuration: /home/php-bin-isp-php70/voishunter/php)
Уже замучился и не знаю в чем проблема...

Прилагаю vhost

<VirtualHost 188.165.192.38:80 [2001:41d0:2:8926::]:80>
	ServerName on-the-go.eu
	ServerAlias www.on-the-go.eu
	DocumentRoot /home/voishunter/data/www/on-the-go.eu/public
	SetEnv APPLICATION_ENV "development"
	ServerAdmin webmaster@on-the-go.eu
	DirectoryIndex index.html index.php
	AddDefaultCharset off
	SuexecUserGroup voishunter voishunter
	CustomLog /home/httpd-logs/on-the-go.eu.access.log combined
	ErrorLog /home/httpd-logs/on-the-go.eu.error.log
	<FilesMatch "\.ph(p[3-5]?|tml)$">
		SetHandler application/x-httpd-php5
	</FilesMatch>
	ScriptAlias /php-bin/ /home/php-bin-isp-php70/voishunter/
	AddHandler application/x-httpd-php5 .php .php3 .php4 .php5 .phtml
	Action application/x-httpd-php5 /php-bin/php
</VirtualHost>
<VirtualHost 188.165.192.38:443 [2001:41d0:2:8926::]:443>
	ServerName on-the-go.eu
	ServerAlias www.on-the-go.eu
	DocumentRoot /home/voishunter/data/www/on-the-go.eu/public
	SetEnv APPLICATION_ENV "development"
	ServerAdmin webmaster@on-the-go.eu
	DirectoryIndex index.html index.php
	AddDefaultCharset off
	SSLEngine on
	SSLCertificateFile "/var/www/httpd-cert/voishunter/on-the-go.eu.crt"
	SSLCertificateKeyFile "/var/www/httpd-cert/voishunter/on-the-go.eu.key"
	SSLCertificateChainFile "/var/www/httpd-cert/voishunter/on-the-go.eu.ca"
	SSLHonorCipherOrder on
	SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
	SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH 
	SuexecUserGroup voishunter voishunter
	CustomLog /home/httpd-logs/on-the-go.eu.access.log combined
	ErrorLog /home/httpd-logs/on-the-go.eu.error.log
	<FilesMatch "\.ph(p[3-5]?|tml)$">
		SetHandler application/x-httpd-php5
	</FilesMatch>
	ScriptAlias /php-bin/ /home/php-bin-isp-php70/voishunter/
	AddHandler application/x-httpd-php5 .php .php3 .php4 .php5 .phtml
	Action application/x-httpd-php5 /php-bin/php
</VirtualHost>
<Directory /home/voishunter/data/www/on-the-go.eu/public>
	Options +Includes -ExecCGI
	RewriteEngine on
	AllowOverride All
    Require all granted
	RewriteCond %{HTTPS} off
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</Directory>
  • Вопрос задан
  • 239 просмотров
Пригласить эксперта
Ответы на вопрос 2
Внимательно прочтите и переведите сообщение, речь идет об отсутствии доступа.
В файле index.php поставьте только
<?php
phpinfo();
?>
и убедитесь, что у вас веб сервер и все что с ним связано работает исправно.
Проверьте все пути и права на файлы.
Ответ написан
@novrm
Регистрация и автозагрузка классов для ZF3 теперь осуществляется через composer.

Было для ZF2 index.php:
<?php
/**
 * This makes our life easier when dealing with paths. Everything is relative
 * to the application root now.
 */
chdir(dirname(__DIR__));
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {
    return false;
}
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();


Стало для ZF3 index.php:
<?php
use Zend\Mvc\Application;
use Zend\Stdlib\ArrayUtils;
/**
 * This makes our life easier when dealing with paths. Everything is relative
 * to the application root now.
 */
chdir(dirname(__DIR__));
// Decline static file requests back to the PHP built-in webserver
if (php_sapi_name() === 'cli-server') {
    $path = realpath(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
    if (__FILE__ !== $path && is_file($path)) {
        return false;
    }
    unset($path);
}
// Composer autoloading
include __DIR__ . '/../vendor/autoload.php';
if (! class_exists(Application::class)) {
    throw new RuntimeException(
        "Unable to load application.\n"
        . "- Type `composer install` if you are developing locally.\n"
        . "- Type `vagrant ssh -c 'composer install'` if you are using Vagrant.\n"
        . "- Type `docker-compose run zf composer install` if you are using Docker.\n"
    );
}
// Retrieve configuration
$appConfig = require __DIR__ . '/../config/application.config.php';
if (file_exists(__DIR__ . '/../config/development.config.php')) {
    $appConfig = ArrayUtils::merge($appConfig, require __DIR__ . '/../config/development.config.php');
}
// Run the application!
Application::init($appConfig)->run();
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
26 апр. 2024, в 09:18
500 руб./в час
26 апр. 2024, в 06:46
1500 руб./в час
26 апр. 2024, в 05:31
1000 руб./за проект