0
votes

I am new in laravel. My friend gives me a project to study, but when I set that project on my localhost I receive some error. Can Anyone help me to set that project on my PC. I Uploaded the server file code[enter image description here][1]

**

Error: Warning: require_once(C:\wamp64\www\hazir/public/index.php): failed to open stream: No such file or directory in C:\wamp64\www\hazir\server.php on line 21 Fatal error: require_once(): Failed opening required 'C:\wamp64\www\hazir/public/index.php' (include_path='.;C:\php\pear') in C:\wamp64\www\hazir\server.php on line 21

**

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

    $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';
1
what's the error code ? can't see the imageMahdi Younesi
Warning: require_once(C:\wamp64\www\hazir/public/index.php): failed to open stream: No such file or directory in C:\wamp64\www\hazir\server.php on line 21 Fatal error: require_once(): Failed opening required 'C:\wamp64\www\hazir/public/index.php' (include_path='.;C:\php\pear') in C:\wamp64\www\hazir\server.php on line 21Mateen Qayum
The error message looks pretty straight forward to me! Do you have a file in C:\wamp64\www\hazir/public/index.php ?Nic3500

1 Answers

0
votes

It seems that you alter the Laravel app and created a file server.php. and accessing files via URI on the public directory of Laravel. Unfortunately, that's not how Laravel application works.

I assumed you're using a Wampserver, by using this, it may cause you a bit of trouble in setting up Laravel app on your machine. I highly suggest using Laragon or the Laravel created Homestead