Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mknparreira/7f5faff432790ee4974980b0fb4afca3 to your computer and use it in GitHub Desktop.
Save mknparreira/7f5faff432790ee4974980b0fb4afca3 to your computer and use it in GitHub Desktop.
PHP | Bug fix Unknown Failed opening required on line 0

Introduction

Sometimes can occoured an error just like this:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\NC World\ProjectName\server.php' 
(include_path='C:\xampp\php\PEAR') in Unknown on line 0

To fix this, must create a file called index.php and put on public/ dir

/**
 * 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';
@mknparreira
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment