2012-09-14 23 views
13

/app_dev.php खोलने के लिए मैं जब कोशिशSymfony 2: 404 नहीं मिला त्रुटि जब tryes

/app_dev.php

An error occurred while loading the web debug toolbar (404: Not Found). 

Do you want to open the profiler? 

खोलने के लिए जब मैं ठीक क्लिक करें यह त्रुटि संदेश मिल रहा है, मैं कर रहा हूँ तो हो रही त्रुटि:

app_dev.php/_profiler/5053258a822e1 

और

404 Not found 

मैं nginx

का उपयोग कर रहा हूं आपकी सहायता के लिए बहुत बहुत धन्यवाद।

संपादित करें: यहाँ त्रुटि लॉग है:

[error] 18369#0: *9 open() "/var/www/Symfony/web/app_dev.php/_wdt/5056f875afc98" failed (20: Not a directory), client: 127.0.0.1, server: symfony, request: "GET /app_dev.php/_wdt/5056f875afc98 HTTP/1.1", host: "symfony", referrer: "http://symfony/app_dev.php" 
[error] 18369#0: *9 open() "/var/www/Symfony/web/404" failed (2: No such file or directory), client: 127.0.0.1, server: symfony, request: "GET /app_dev.php/_wdt/5056f875afc98 HTTP/1.1", host: "symfony", referrer: "http://symfony/app_dev.php" 

संपादित करें 2:

जब मैं का उपयोग करने की app_dev.php पेज उपकरण पट्टी के बिना लेकिन खोलता कोशिश करते हैं और जब मैं app_dev.php के साथ प्रयास करें/मुझे

**Oops! An Error Occurred 
The server returned a "404 Not Found". 
Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. ** 

त्रुटि मिल रही है।

+1

क्या आप अपना nginx त्रुटि लॉग पोस्ट कर सकते हैं? (न केवल आपके ब्राउज़र में मुद्रित किया गया है!) – Florent

+0

धन्यवाद फ्लोरंट, मैंने अपना प्रश्न बदल दिया –

+0

हल किया गया, मेरा जवाब यहां देखें: http://stackoverflow.com/a/30313196/1700429 – Dahab

उत्तर

10

मैं जानता हूँ कि यह वास्तव में नहीं है कि तुम क्या कहा लेकिन भविष्य लोग हैं, जो इस समस्या के लिए खोज, @yvoyer तरह का सुझाव दिया है मदद कर सकता है, मेरा मुद्दा पिछला स्लैश था, मेरे सर्वर ने nginx और fpm का उपयोग किया, और nginx // में euqal/नहीं है, इसलिए मुझे अपने वर्चुअल होस्ट conf पर कुछ फिक्स करना पड़ा और इसके बाद ठीक काम किया। मैं इसे किसी भी व्यक्ति की आवश्यकता के लिए बस पेस्ट पेस्ट करूंगा, या एक बेहतर सुझाव देता हूं।

location/{ 
      try_files $uri @pass_to_symfony; 
    } 

    location ~ /app_dev.php/ { 
      try_files $uri @pass_to_symfony_dev; 
    } 

    location @pass_to_symfony{ 
      rewrite^/app.php?$request_uri last; 
    } 

    location @pass_to_symfony_dev{ 
      rewrite^/app_dev.php?$request_uri last; 
    } 

    location ~ ^/app(_dev)?\.php($|/) { 
      include fastcgi_params; 
      fastcgi_pass unix:/var/run/php5-fpm.sock; # replace with your sock path 
    } 
0

सिम्फनी 2 पृष्ठ में डेवलपर मोड में वेब डीबग टूलबार प्रदर्शित करने के लिए वैध HTML होना चाहिए।

+0

धन्यवाद @ राफल, लेकिन मैं app_dev.php फ़ाइल खोलने की कोशिश कर रहा हूं, यह आता है सिम्फनी वेबसाइट। इस समस्या को कैसे हल करें? –

-1

मुझे समाधान (अधिक या कम) मिला है। मैंने एक और मौजूदा सिम्फनी परियोजना ली और सब कुछ ठीक काम करता है। मैं वास्तव में नहीं जानता कि क्यों सिम्फनी मानक रिलीज मेरे मामले में काम नहीं कर रहा है ... अगर कुछ कोबी को खाली सिम्फनी प्रोजेक्ट की ज़रूरत है, तो मैं संग्रह अपलोड कर सकता हूं।

संपादित करें: http://www.megafileupload.com/en/file/372986/Symfony-tpl-zip.html

+0

कृपया संग्रह अपलोड करें, मुझे एक ही समस्या है – tesmojones

+2

यहां सिम्फनी टेम्पलेट है। आनंद लें: http://www.megafileupload.com/en/file/372986/Symfony-tpl-zip.html अगर आपको यह उपयोगी लगता है, तो कृपया ऊपर उठाएं। धन्यवाद। –

3

मैं एक ही त्रुटि थी, लेकिन मैं जब मैं app_dev.php/ टाइप किया पता चला कि संदेश उत्पादन था, लेकिन नहीं जब app_dev.php का अनुरोध (ध्यान स्लैश: यहाँ काम Symfony 2.0 टेम्पलेट है /)।

मुझे लगता है कि यह रूटर से कोई लेना देना नहीं है, लेकिन इसकी सिर्फ एक शिक्षित अनुमान

-3

कृपया अपने .htaccess पर ध्यान देने का प्रयास करें, मुझे यह समस्या भी थी और मैंने अपना तय किया।

<IfModule mod_rewrite.c> 
    RewriteEngine On 
     RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 
    RewriteRule ^(.*) - [E=BASE:%1] 
    RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
    RewriteRule ^app_dev.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially 
    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteRule .? - [L] 
    RewriteRule .? %{ENV:BASE}/app_dev.php [L]  ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially 
    </IfModule> 

    <IfModule !mod_rewrite.c> 
    <IfModule mod_alias.c> 
     # When mod_rewrite is not available, we instruct a temporary redirect of 
     # the startpage to the front controller explicitly so that the website 
     # and the generated links can still be used. 
     RedirectMatch 302 ^/$ /app.php/ 
     # RedirectTemp cannot be used instead 
    </IfModule> 
    </IfModule> 
+5

कृपया पूरी पोस्ट को पहले पढ़ें: "मैं nginx का उपयोग कर रहा हूं आपकी मदद के लिए बहुत बहुत धन्यवाद।" जबकि आपकी टिप्पणी APACHE के लिए उपयुक्त है, यह लोगों को पेंच कर देगा। – Zjoia

-1

यह मेरी देव environnement में हुआ, इसलिए मैं अपने vhost कॉन्फ़िग फ़ाइल में निर्देश DirectoryIndex टिप्पणी है, इसलिए अब मैं साथ मेरे ऐप पर मिलती है: प्रोफाइलर के बारे में कोई अधिक त्रुटियों http://127.0.0.1/app_dev.php और! मैं सिम्फनी 2.3.x का उपयोग करता हूं।

0

मेरी त्रुटि Nginx कॉन्फ़िगरेशन से संबंधित थी (सिम्फनी 3 का उपयोग करके।1), और मैं बस Symfony से Nginx के लिए सिफारिश की config संपादित:

http://symfony.com/doc/current/setup/web_server_configuration.html

तो, शायद यह था, क्योंकि सिमलिंक की, मैं नहीं जानता।

मैं Nginx डिफ़ॉल्ट config करने के लिए एक छोटा सा हिस्सा नकल की और सभी .php मैच के लिए संपादित:

## 
# You should look at the following URL's in order to grasp a solid understanding 
# of Nginx configuration files in order to fully unleash the power of Nginx. 
# http://wiki.nginx.org/Pitfalls 
# http://wiki.nginx.org/QuickStart 
# http://wiki.nginx.org/Configuration 
# 
# Generally, you will want to move this file somewhere, and start with a clean 
# file but keep this around for reference. Or just disable in sites-enabled. 
# 
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. 
## 

# Default server configuration 
# 
server { 
    listen 80 default_server; 
    listen [::]:80 default_server; 

    # SSL configuration 
    # 
    # listen 443 ssl default_server; 
    # listen [::]:443 ssl default_server; 
    # 
    # Note: You should disable gzip for SSL traffic. 
    # See: https://bugs.debian.org/773332 
    # 
    # Read up on ssl_ciphers to ensure a secure configuration. 
    # See: https://bugs.debian.org/765782 
    # 
    # Self signed certs generated by the ssl-cert package 
    # Don't use them in a production server! 
    # 
    # include snippets/snakeoil.conf; 

    root /var/www/html; 

    # Add index.php to the list if you are using PHP 
    index index.html index.htm index.nginx-debian.html; 

    server_name _; 

    location/{ 
     # First attempt to serve request as file, then 
     # as directory, then fall back to displaying a 404. 
     try_files $uri $uri/ =404; 
    } 


    # Symfony 
    location ~ \.php(/|$) { 
      fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
     fastcgi_split_path_info ^(.+\.php)(/.*)$; 
     include fastcgi_params; 
     # When you are using symlinks to link the document root to the 
     # current version of your application, you should pass the real 
     # application path instead of the path to the symlink to PHP 
     # FPM. 
     # Otherwise, PHP's OPcache may not properly detect changes to 
     # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 
     # for more information). 
     fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 
     fastcgi_param DOCUMENT_ROOT $realpath_root; 
    } 


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
    # 
    #location ~ \.php$ { 
    # include snippets/fastcgi-php.conf; 
    # 
    # # With php7.0-cgi alone: 
    # fastcgi_pass 127.0.0.1:9000; 
    # # With php7.0-fpm: 
    # fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
    #} 

    # deny access to .htaccess files, if Apache's document root 
    # concurs with nginx's one 
    # 
    #location ~ /\.ht { 
    # deny all; 
    #} 

} 


# Virtual Host configuration for example.com 
# 
# You can move that to a different file under sites-available/ and symlink that 
# to sites-enabled/ to enable it. 
# 
#server { 
# listen 80; 
# listen [::]:80; 
# 
# server_name example.com; 
# 
# root /var/www/example.com; 
# index index.html; 
# 
# location/{ 
#  try_files $uri $uri/ =404; 
# } 
#} 

मैं एक उत्पादन सर्वर के लिए Symfony सिफारिश के लिए चिपके की सिफारिश करेंगे।

संबंधित मुद्दे