0

I am running on Laravel 5.3. Whenever I try to php artisan serve and type localhost:8000, It returns phpinfo. Now additional confusion has it when I cancel the serve then refresh it still shows the phpinfo

phpinfo

Is there any solution to this as to what have I messed up(I am using mac air) Any help would be great!

3
  • what is your console is showing ? Commented Sep 20, 2016 at 9:45
  • Hi, @AbdouTahiri, it shows nothing. Is it in my inner configs? also i've tried without serve it still shows.
    – Reyn
    Commented Sep 20, 2016 at 9:47
  • how checked the port 8000 ? Commented Sep 20, 2016 at 9:48

3 Answers 3

0

Try another command to change the port of the localhost :

php -S localhost:1988 -t public 
4
  • not an existing directory, what i've found though is that my machine favors the nginx over my artisan command. when I killed the server(nginx) it all stopped even though I've runned the serve command.
    – Reyn
    Commented Sep 20, 2016 at 10:19
  • 1
    You're using OS right ? if Yes then do sudo apachectl restart
    – Nour
    Commented Sep 20, 2016 at 10:20
  • Thanks It worked! by the way. is laravel using apache as its main server?
    – Reyn
    Commented Sep 20, 2016 at 11:59
  • Laravel recommends using Homstead which uses Nginx not Apache
    – Nour
    Commented Sep 20, 2016 at 12:12
0

First check your :8000 port may be its busy .

netstat -anp tcp | grep 8000

You can kill it or try to load it using another port .

php artisan serve --port=8080
5
  • tcp4 0 0 *.8000 *.* LISTEN that is the result
    – Reyn
    Commented Sep 20, 2016 at 9:51
  • do you have a running vbox on that port ? Commented Sep 20, 2016 at 10:12
  • I've checked my local machine. It seems like my nginx server is the priority of it all. when I killed the server the phpinfo didnt work. now when I ran serve again, it still wont work.
    – Reyn
    Commented Sep 20, 2016 at 10:18
  • is MAMP considered a vbox?
    – Reyn
    Commented Sep 20, 2016 at 10:19
  • no, but you might need to check why its not working on :8000, however have you tried to serve on another port ? php artisan serve --port=8080 Commented Sep 20, 2016 at 10:31
0

Faced a similar problem. Any use of php artisan returned phpinfo(). The reason was the incorrect code dd(phpinfo()) in my routes/web.php:

Route::any('/any', dd(phpinfo()));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.