代码之家  ›  专栏  ›  技术社区  ›  suresh

Zend framework快速启动索引文件不工作

  •  0
  • suresh  · 技术社区  · 6 年前

    https://framework.zend.com/manual/1.12/en/learning.quickstart.create-project.html

    当我跑的时候 http://localhost/quickstart/

    它正在显示未运行的文件的索引索引.php文件

    谁能帮我一下我犯了什么错误,我使用的是ubuntu服务器

    下面是我遵循的东西,我下载了两个zip文件,一个是zendAuth,另一个是和zendframework1.12.20 我创建了一个名为quickstart的文件夹,并将这些文件移到了quickstart中。

    /var/www/quickstart/zendAuth/Zemdframeowrk 1.12.20

    php.ini 变化 /etc/php/7.2/apache2/php.ini include_path = ".:/var/www/quickstart/zendAuth/library"

    在那之后 apache2.conf

     <VirtualHost *:80>
        DocumentRoot "/var/www"
        ServerName localhost
    </VirtualHost>
        <VirtualHost *:80>
            ServerName quickstart.local
            DocumentRoot /var/www/html/quickstart/zendAuth/public
    
            SetEnv APPLICATION_ENV "development"
    
            <Directory /var/www/html/quickstart/zendAuth/public>
                DirectoryIndex index.php
                AllowOverride All
                Order allow,deny
                Allow from all
            </Directory>
        </VirtualHost>
    
    And in hosts file at the top  of the file i have added this  `127.0.0.1    quickstart.local`
    
    Can any one check and let me where i have done mistake and please help me out.
    

    1 回复  |  直到 6 年前
        1
  •  4
  •   Vivek Sangani    6 年前

    您可以尝试以下配置,然后为根文件夹和公用文件夹设置.htaccess:

    127.0.0.1       quickstart.local
    

    <VirtualHost *:80>
        ServerName quickstart.local
        DocumentRoot "/var/www/html/quickstart/zendAuth/public"
        ServerAlias quickstart.local
        <Directory "/var/www/html/quickstart/zendAuth/public">
            AllowOverride All
            Require all granted
         </Directory>
    </VirtualHost>
    

    3) 检查根目录访问,如下所示

    SetEnv APPLICATION_ENV development
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* index.php [L]
    IndexIgnore *
    Options -Indexes
    

    4) 检查公用文件夹中的htacess,如下所示

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+?)/$ /$1 [R=302,NE,L]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [L]
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]
    RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]
    RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]