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.

Optymystyc
  • 130
  • 1
  • 11
  • How did you install Laravel? Did you use Composer? A Zip file? Some other way? – maiorano84 Oct 21 '16 at 01:43
  • I installed using Composer. – Optymystyc Oct 21 '16 at 01:43
  • And you didn't get any warnings? [Laravel requires PHP 5.6.4 or greater](https://github.com/laravel/laravel/blob/master/composer.json). – maiorano84 Oct 21 '16 at 01:45
  • I didn't get any warnings. I tried updating my version of PHP on mac to 5.6 but for some reason it's still showing 5.4. – Optymystyc Oct 21 '16 at 01:52
  • 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 ``. `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? – maiorano84 Oct 21 '16 at 02:02
  • Seeing 5.4.10. I used `curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6` – Optymystyc Oct 21 '16 at 02:10
  • 1
    @maiorano84 You were right! I followed the instructions [here](https://gist.github.com/irazasyed/5987693) and got it working! Thanks! – Optymystyc Oct 21 '16 at 02:33
  • Great job! Feel free to post as an answer and accept it in case others have a similar problem. – maiorano84 Oct 21 '16 at 02:44

3 Answers3

4

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

composer dump-autoload

php artisan clear-compiled

composer clear-cache

cresjie
  • 469
  • 2
  • 13
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.

Kamran Syed
  • 439
  • 3
  • 7
-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.