简体   繁体   中英

Always getting blank page on all Laravel routes

I am always getting blank page while accessing my Laravel project given below. Please advise how this problem can be resolved. Thanks!

http://1.231.118.4:9000/

http://1.231.118.4:9000/admin/login

Apache 2.4 PHP 7.2 MySQL 5.7

phpinfo: http://1.231.118.4:9000/info.php

vhost:

<VirtualHost *:9000>
    ServerName 1.231.118.4
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/ico/public
    <Directory /var/www/html/ico/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
     </Directory>
    ErrorLog /var/www/html/ico/error.log
</VirtualHost>

.htaccess:

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

    RewriteEngine On

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

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

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

i had the same issue and it turned out that all codes in my index.php file in public directory was commented ! you can give it a try

In my app\\Providers\\RouteServiceProvider.php file, the routes were serviced on 443 port that's why I was getting 404 on all routes. Thanks everybody anyways.

    public function map()
    {
        switch(request()->getPort()){

          case 9001:
                //exit;
              break;
          case 443:
              $this->mapAdminWebRoutes();
              $this->mapApiRoutes();
              $this->mapWebRoutes();
              break;
         // choose a port that is not used by another server
          default:
          $this->mapAdminWebRoutes();
              $this->mapApiRoutes();
              $this->mapWebRoutes();
              break;
        }
    }

In my case, .env file had an entry with bad format, since spaces are not allowed in values without quotes for all value:

#BAD
DATETIME_FORMAT=Y-m-d H:i:s
#GOOD
DATETIME_FORMAT="Y-m-d H:i:s"

For some reason this error did not output anything nowhere, hope will be useful to someone with the same problem!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM