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

fabianhenzler's avatar

Laravel Valet - show all php errors

Hi, I'm trying to show all the errors and warning. In my wp-config.php (Wordpress) I included

@ini_set('display_errors', 1);
@ini_set('display_startup_errors', 1);
@error_reporting(E_ALL);

and in the /usr/local/etc/php/7.1/php.ini

error_reporting = E_ALL
display_errors = On
display_startup_errors = On

those are also set. But I see no errors and just get an NGINX 502 without knowing what's going on :(

0 likes
3 replies
dhaval48's avatar

got same issue,

but it's really easy, go to ~/.valet/Drivers

modify the file SampleValetDriver.php file and add three lines at the begining

<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

class SampleValetDriver extends ValetDriver
{
    /**
     * Determine if the driver serves the request.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return bool
     */
    public function serves($sitePath, $siteName, $uri)
    {
        // if (file_exists($sitePath.'/file-that-identifies-my-framework')) {
        //     return true;
        // }

        return false;
    }

    /**
     * Determine if the incoming request is for a static file.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string|false
     */
    public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }

    /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string
     */
    public function frontControllerPath($sitePath, $siteName, $uri)
    {
        return $sitePath.'/public/index.php';
    }
}

1 like
mishajib's avatar

Thank you very much for giving the solution...

Please or to participate in this conversation.