2017-01-31 4 views
-2

Wenn ich versuche, mein Projekt auszuführen, bekomme ich nur die Ordnerstruktur. Warum?So führen Sie ein Symfony-Projekt ohne diese Ordnerstruktur aus

Index of/my_project

Parent Directory    
README.md 
bin/ 
composer.json   
composer.lock 
vendor/ 
web/ 

Apache/2.4.7 (Ubuntu) Server auf localhost Port-80

+0

hier beantwortet, index.php nicht läuft direkt –

+0

Ist es ein Symfony-Projekt als der Tag impliziert? Wenn ja, müssen Sie feststellen, was mit den Verzeichnissen app und src passiert ist. Es ist auch sehr unklar, wie "mein Projekt ausführen" zu einer Verzeichnisstruktur führen würde. – Cerad

Antwort

0

Sie benötigen .htaccess oder httpd.conf konfigurieren die für den Zugriff auf Web-Ordner

Lösung # 1:

erstellen .htaccess Datei mit den folgenden Datei-Inhalt in der DocumentRoot Ordner (im Grunde der Ort, an dem Sie diese Ordnerstruktur sehen)

Options +FollowSymLinks +ExecCGI 

    RewriteEngine On 

    # uncomment the following line, if you are having trouble 
    # getting no_script_name to work 
    RewriteBase /web 

    # we skip all files with .something 
    RewriteCond %{REQUEST_URI} \..+$ 
    RewriteCond %{REQUEST_URI} !\.html$ 
    RewriteRule .* - [L] 

    # we check if the .html version is here (caching) 
    RewriteRule ^$ app.php [QSA] 
    RewriteRule ^([^.]+)$ $1.html [QSA] 
    RewriteCond %{REQUEST_FILENAME} !-f 

    # no, so we redirect to our front web controller 
    RewriteRule ^(.*)$ index.php [QSA,L] 

Lösung # 2:

Sie kann auch die httpd.conf abhängig von Ihrem Webhosting-Anbieter anpassen, wenn das der Fall ist, würde ich diese Seite auf symfony konsultieren: http://symfony.com/doc/current/setup/web_server_configuration.html

Update: Bitte diese Frage markiert als beantwortet, wenn es Ihre Frage

Verwandte Themen