LARAVEL default page not loading - Error 324 - ERR_EMPTY_RESPONSE

99封情书 提交于 2019-12-13 05:19:02

问题


+Apache2
+PHP5.5
+Laravel4

After installing laravel, I go to http://localhost and chrome gives me an ERR_EMPTY_RESPONSE error.

If I create in the public folder an index2.php file that just echo "hello", it works fine!

Everytime I try to access localhost, a line like this is added in the Apache's log:

[Sat Jul 26 14:38:37.083511 2014] [core:notice] [pid 9562] AH00051: child pid 10025 exit signal Segmentation fault (11), possible coredump in /etc/apache2

and this crash happens:

  • http://s13.postimg.org/9eboxt8t3/screenshot.jpg
  • http://s11.postimg.org/tadttjdzn/screenshot2.jpg

These are my conf files:

apache2.conf

<Directory /servidor/show/public>
    AllowOverride All
    allow from all
    Options +Indexes
    Require all granted
</Directory>

000-default.conf

<VirtualHost *:80>
    DocumentRoot "/servidor/show/public"
    ServerName tadflex.dev
    ServerAlias tadflex.dev

    <Directory "/servidor/show/public">
        AllowOverride All
        allow from all
        Options +Indexes
        Require all granted
    </Directory>
</VirtualHost>

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On
    RewriteBase /public/

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I've been for the last 2 days trying to do everything I found in stackoverflow threats... but nothing helped.

I have tried re-installing apache but it didn't work.

Do you have any clue what may be going on?

Thanks


回答1:


Hello try to increase the memory of your .htaccess file

php_value memory_limit 128M

Options -MultiViews

    php_value upload_max_filesize 500M
    php_value post_max_size 1000M
    php_value memory_limit 128M

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]




回答2:


Maybe unrelated to your situation, but I encountered this ERR_EMPTY_RESPONSE error myself when deploying my Laravel 5.3 project to my VPS.

When calling the support desk of my hosting, they were able to detect that the error was caused by OPCache (specifically a zend_mm_heap corrupted error). After disabling OPCache in my .htaccess the error disappeared (see .htaccess file below).

If anybody knows more regarding this matter, please let me know!

Please note that disabling OPCache will decrease performance, for more information see this Stackoverflow post.

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    php_flag opcache.enable Off

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>



回答3:


I had exactly the same error in chrome and a "can't open page" in Safari.

Went through the bootstrap code and found out that loading the compiled.php was the cause. The file had some errors in it.

As "php artisan optimize --force" didn't help (rebuilt the file) I just commented out the loading of it in autoload.php.

Might not solve the root cause but at least help to get started with laravel.



来源:https://stackoverflow.com/questions/24971824/laravel-default-page-not-loading-error-324-err-empty-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!