0
+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:

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

NikiC
  • 100,734
  • 37
  • 191
  • 225
Inigo EC
  • 2,178
  • 3
  • 22
  • 31
  • Did you check for any APC incompatibility with your php version? – Dimitrios Kontoulis Jul 26 '14 at 14:17
  • Thanks for answering Dimitris; how can I check that? – Inigo EC Jul 26 '14 at 14:24
  • you can check it with phpinfo(); or you could if(extension_loaded('apc') && ini_get('apc.enabled')) { echo "APC enabled!"; }. Also, have you tried in any other browser than chrome? – Dimitrios Kontoulis Jul 26 '14 at 15:38
  • Does it work with Firefox or Safari? I remember myself fighting with ERR_EMPTY_RESPONSE and Chrome before. – Unnawut Jul 26 '14 at 18:31
  • Thanks both for your answer; Firefox gives a"not server found" error. It seems I don't have APC installed, I can't find it at all in the phpinfo(), and when I execute a script with that condition it returns a white page... Can it be a problem with Composer? how can I check it? – Inigo EC Jul 26 '14 at 18:45
  • This is the way the Ubuntu system crashes when I try to access localhost: Screenshot1: http://s13.postimg.org/9eboxt8t3/screenshot.jpg ; Screenshot2: http://s11.postimg.org/tadttjdzn/screenshot2.jpg – Inigo EC Jul 26 '14 at 19:37

3 Answers3

2

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]

  • You give me the clue! Increasing memory limit in my php.ini limit avoid segmentation fault. Then I get other errors on /var/log/apache... related to permissions. Chmod solve them and now the app is running – Gonzalo Cao Feb 09 '17 at 15:10
1

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>
Community
  • 1
  • 1
Ewerkema
  • 41
  • 4
0

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.

danny
  • 43
  • 7