Question

[Solved] php – Unknown: Failed opening required on line 0. laravel 5.6

I just installed laracast/flash and updated nesbot/carbon via composer. The cmd went nuts while downloading carbon. Cmd interface displayed scattered words and boxes all over the interface for a while and the download was completed.
Did php artisan serve at localhost:8000 and I’ve got the following errors.

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required ‘C:xampphtdocsNC WorldProjectNameserver.php’ (include_path=”C:xamppphpPEAR”) in Unknown on line 0

Solution #1:

Try to disable your anti-virus, this happens to me, it seems avast deletes my server.php.

So I added it to the exception

Respondent: Ikong

Solution #2:

This error happens because the server.php file is missing. May be it is deleted or removed from your project directory. I have already faced this problem. Just add the server.php file at root of your project. You can add this file from any other laravel project directory or just create a file named server.php at root directory of your laravel project and paste the following code:

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

This process works for me.

Respondent: rroy

Solution #3:

Type in the command line:

php -S localhost:8000 -t public

because port is not public

Respondent: Laid said

Solution #4:

go to main directory and create new server.php file even you can also copy paste from another created project

same happens to me and i just remove antivirus from my system and just create new file of server

Respondent: WoW Technologies

Solution #5:

You can also go in your antivurus params and restore server.php + add an exception it worked fine for me without recreate a project.

Respondent: Ari

Solution #6:

same problem happen to me:
just delete the project and uninstall the avast antivirus and re create the project

Respondent: neehal maalik

Solution #7:

This same thing happens with me just create new laravel project and copy server.php from the new project and paste it to your project

Respondent: Rabby

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy