Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ottaviane's avatar

Solved: Laravel homepage is blank and no log from Laravel

SOLUTION: I edited /etc/php/7.4/apache2/php.ini uncommenting 'error_log = syslog' :

; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
error_log = syslog

ORIGINAL QUESTION

Hi all, after I installed a new server with ubuntu 21.04, apache 2.4.48, php8.0 my sites doesn't works: I obtain a blank page. I'm sure that apache module is ok, but I don't understand where to read logs. I made:

sudo tail -f /var/log/syslog
sudo tail -f /var/log/apache/error.log

but I have no logs! Can you help me please? where can i find logs?

0 likes
8 replies
jlrdw's avatar

There has to be something in either the apache error log, or laravel log.

Does a simple php file with an echo something work?

2 likes
sr57's avatar

where can i find logs?

/var/log/apache2/error.log

journalctl -ex ("ex syslog")

storage/logs/laravel.log

1 like
siangboon's avatar

check your apache config etc, there is where your log defined....

i.e.: /etc/apache2/sites-available/domain.com.conf

i think you should check how to configure the document root for laravel as well...

2 likes
ottaviane's avatar

Ok thanks all. I have this :

sudo nano /etc/apache2/sites-available/authServer.conf 

<VirtualHost *:443>
   ServerAdmin [email protected]
   ServerName authServer
   ServerAlias authserver
   ServerAlias authserver.sr.dipvvf.it

   DocumentRoot /var/www/authServer/public
    <Directory /var/www/authServer>
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
    SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
    ErrorLog /error.log
    CustomLog /access.log combined
</VirtualHost>
sudo tail -f /var/log/apache2/error.log
and other logs echoes nothing

but I modified public/index.php commenting all lines and adding an "echo 'ciao';" So I discovered that the problem is in this code-line:

$response = $kernel->handle($request = Illuminate\Http\Request::capture());

Is it that makes the block!!! Why? What can I do? I installed those for php:

php8.0-{cli,curl,bcmath,mbstring,xml,zip,phpdbg,odbc,mysql,ldap,common}

and enabled mod rewrite

sudo a2enmod rewrite

what is my mistake? Hi all and thanks

sr57's avatar

@ottaviane

Does the logs are active in php settings? '(you should see some errors)

Which version of Laravel?

Maybe a old one, and so you should test with the previous version ( 7.4 ) of php.

You can install it with php 8 just by specifying php7.4 in your apt command, and then use a2dismod & a2enmod to disable php8.0 & enable php7.4

2 likes
ottaviane's avatar

@sr57 I think the logs are active... but I cant't see any error in log... How can I verify it? Laravel version is 7.2 and php is 8.0 So you say to downgrade php? In Ubuntu 21.10 I can't instal php7.4. But if I upgrade Laravel version? Is it a good idea? In Laravel 7.4 I customized Login system... In newer Laravel version can I use the same myClasses for the Auth system? Thanks and bye.

sr57's avatar
sr57
Best Answer
Level 39

@ottaviane

logging - How can I verify it?

php.ini / phpinfo();

https://www.php.net/manual/fr/errorfunc.configuration.php#ini.log-errors

But if I upgrade Laravel version?

Should work too, but probably more "difficult"/long due to some changes in the code to do (and without error logs ... )

If you have a code that works on a specific version , it should work on the same version on another server (it 's easier to split the problem between server config and version update)

2 likes
ottaviane's avatar

@sr57 Ok I enabled log editing php.ini and finally I have some infos in syslog: I'm reading Ok solved with downgrade of php to 7.4

Please or to participate in this conversation.