0

I'm following the official Laravel course (currently the first chapter "Meet Composer,"), but I can't seem to get it right. In the course I was instructed to enter in the command line:

php -S localhost:8888 -t public

and I should be able to reach the URL: "http://localhost:8888/learning-laravel-5", but this gives me a 404 error.

But if I put in this URL I get to see the frontpage, as it should: http://localhost:8080/learning-laravel-5/public/index.php

My question is, how can I see the frontpage as instructed in the video, following the provided URL: http://localhost:8888/learning-laravel-5 ?

I have looked through the duplicate questions on stackoverflow but I can't find a solution to this problem.

Edit: I have tried to get my absolute path by doing pwd, its says "/media/sf_sandbox/laracast-4.2", I now have done this: "php -S localhost:8888 -t /media/sf_sandbox/laracast-4.2/public". I now go to localhost:8888 but it still doesn't work.

It says my documentroot is /media/sf_sandbox/learning-laravel-5/public

Ducky
  • 409
  • 1
  • 7
  • 24

2 Answers2

0

If you are running below command from the project root learning-laravel-5 , than localhost:8888 it self points to the learning-laravel-5/public folder

php -S localhost:8888 -t /var/www/html/learning-laravel-5/public

In this case only localhost:8888 should work and you don't need to append learning-laravel-5 after that.

pinkal vansia
  • 10,240
  • 5
  • 49
  • 62
  • Sorry @pinkal, this does not work for me, I typed "php -S localhost:8888 -t public", I got a response with "Listening on http://localhost:8888" but when I go to http://localhost:8888/ I just see that the page isn't available. – Ducky Jul 27 '15 at 09:34
  • @Joop Try absolute path. I have Updated my answer. – pinkal vansia Jul 27 '15 at 09:40
  • Hi @pinkal, I have tried to get my absolute path by doing pwd, its says "/media/sf_sandbox/laracast-4.2", I now have done this: "php -S localhost:8888 -t /media/sf_sandbox/laracast-4.2/public". I now go to http://localhost:8888/ and still nothing happens, though it says it's listening to the url localhost:8888. I'm really wondering what I'm doing wrong. – Ducky Jul 27 '15 at 10:35
0

It seems like you are using XAMP..because For XAMP, localhost port is 8000 And For XAMP, localhost port is 8000.

in the laravel directory, where you ran composer, type php artisan serve. This will run an internal webserver, which opens up 8000 port by default. Once you have that, open your browser and access http://localhost:8000

If that works, you have an issue with your MAMP configuration.

If it is MAMP, check the following

1) make sure you set the document root to the /public directory in your laravel installation.

2 make sure you have enabled rewrite module in your mamp.

Checkout How to get htaccess to work on MAMP

Community
  • 1
  • 1
Itz Raghu
  • 457
  • 2
  • 6
  • 16
  • I'm not using any of those packages, I have a Ubuntu virtualbox LAMP running. To add: I'm using port 8080, and I want to use 8888, not 8000 as you specified. – Ducky Jul 25 '15 at 21:06