3

I'm trying to develop a Laravel app locally and I'm running php artisan serve. It works until I visit localhost:8000 and then the server stops. I've tried changing the port using sudo php artisan server --port=80 but that doesn't fix it.

I haven't written a line of code yet. If it helps I'm running PHP 5.4 on OS X Mavericks.

8
  • How did you install Laravel? Did you use Composer? A Zip file? Some other way? Commented Oct 21, 2016 at 1:43
  • I installed using Composer. Commented Oct 21, 2016 at 1:43
  • And you didn't get any warnings? Laravel requires PHP 5.6.4 or greater. Commented Oct 21, 2016 at 1:45
  • 1
    It sounds like your PHP CLI isn't symlinked to the new installation path. Test something for me: In a separate folder, create an index.php file that contains only <?php phpinfo(): ?>. cd into that directory, and run php -S localhost:8000. You should be able to navigate to localhost:8000 and see details on your PHP installation. Do you get PHP version 5.6 there? If so, what version do you see when running php -v in your command line? How did you install the new PHP version? Homebrew? Compiled? Something else? Commented Oct 21, 2016 at 2:02
  • 1
    @maiorano84 You were right! I followed the instructions here and got it working! Thanks! Commented Oct 21, 2016 at 2:33

3 Answers 3

4

i think your experiencing segmentation fault(core dumped), try running this commands

composer dump-autoload

php artisan clear-compiled

composer clear-cache

Sign up to request clarification or add additional context in comments.

Comments

2

Please check if you have Avast Antivirus. This antivirus detects server.php as a threat (silently) and blocks it.

As a result, browser works good for the first request and then keeps waiting. Noting comes up on subsequent requests. Solution is to add an exception in antivirus. This problem is specific to Laravel.

Comments

-1

If you are using Avast Antivirus, this will delete the server.php file assuming as a threat. You have to create an exception for this. Goto Avast Anitvirus -> Menu -> Settings -> General -> Exceptions. Add exception server.php file path here (add server.php file if it doesn't exist) and run the "php artisan serve" command.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.