R
R
Rickern2021-07-09 14:19:46
Apache HTTP Server
Rickern, 2021-07-09 14:19:46

How to fix 503 Service Unavailable error in Laravel?

There is an apache server on astra linux, I created a virtual host, loaded the laravel project, but when I open localhost it gives an error

503 Service Unavailable
No server is available to handle this request.

If you run the same project, but through php artisan serv, then everything works.
Tried adding another virtual host with standard apache page, it runs on localhost
How to fix this?

testsite.local.conf

<VirtualHost *:80>
  ServerName testsite.local
  ServerAdmin [email protected]
  DocumentRoot /var/www/testsite.local/public
  
  <Directory "/var/www/testsite.local/public">
        Options Indexes FollowSymLinks Includes execCGI
        AllowOverride All
        Require all granted
    </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>



I looked through the apache logs and found this error:
[proxy_fcgi:error] [pid 7237] [client 127.0.0.1:56814] 806: Got error 'PHP message: PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/testsite.local/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php on line 177\n'


What does the error indicate:
function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void
    {
        Assert::assertContainsOnly(...func_get_args());
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2021-07-09
@pLavrenov

Let's Play Pathfinder Dora:
Laravel Blue Screen Displayed?
Answer:
Incorrect path to the public folder (can be checked like this testsite.local.conf/public )
Incorrect route Is
the white standard displayed?
Answer:
Laravel has nothing to do with it
. In any unclear situation, Laravel throws errors:
The .env file must have
APP_ENV=local
APP_DEBUG=true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question