1
votes

I am unable to run my laravel project locally i am using version 5.5 i have run command composer update and also composer install but i am unable to solve my error when i run coommad php artisan serve it says [32mLaravel development server started on http://localhost:8000/[39m

I dont understand 32m and 39m here and when i hit url http://localhost:8000 on my browser the erros are dislaying

Warning: require_once(G:\xampp\htdocs\project/public/index.php): failed to open stream: No such file or directory in G:\xampp\htdocs\project\server.php on line 21

Fatal error: require_once(): Failed opening required 'G:\xampp\htdocs\project/public/index.php'(include_path='G:\xampp\php\PEAR') in G:\xampp\htdocs\project\server.php on line 21

can anyone please help me to sort out this issue.

Your help will be highly appreciated!

2
The 32m and 39m are just color codes. You can ignore that part. Can you show your directory schema? Does G:\xampp\htdocs\project\public\index.php exist?aynber
yeah its existsshahzad shah
composer dump-autoload try running this. This command will clean up all compiled files and their paths.Christian Gallarmin
okay the project is running on local but css and js files are not loading sucessfully images are crash and not showing any view completlyshahzad shah
Make sure you're loading css and js files with absolute paths (ie starting with a slash and from the document root, /css/file.css) instead of relative pathsaynber

2 Answers

0
votes

First you need to run

composer dump-autoload

this will clean up all compiled file.

Then you need to reference your css and JS like this

<script src="URL::to('/')/main.js"></script>

and

<link rel="stylesheet" href="URL::to('/')/style.css" />
0
votes

shahzad, Make sure the following things are intact.

  1. Place all your assets(css, js, images) in the public folder
  2. Check whether your asset URI pointing to assets in public folder under network tab of browser developer tools
  3. Make sure your assets have the proper read and write permissions.