Does PHP has its own Web Server? [duplicate]

大兔子大兔子 提交于 2021-01-04 12:43:17

问题


I'm working on a Symfony 3 Project on my machine Ubuntu 16 and I haven't install XAMPP or LAMP yet and I launch

php bin/console server:start
[OK] Server listening on http://127.0.0.1:8000 

So the HTTP request to localhost:8000 is responding correctly but I'm asking if that means automatically that apache is installed in my machine ?

I see many alternatives to check if apache is installed and this is the system response:

alternative 1:

apache2 -v 
The program 'apache2' is currently not installed. You can install it by typing:
sudo apt install apache2-bin

alternative 2:

dpkg --get-selections | grep apache
libapache-pom-java              install

alternative 3:

apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: 2.4.18-2ubuntu3.5
  Version table:

alternative 4:

//check who is listening on localhost:8000
lsof -i :8000
COMMAND  PID          USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php7.0  5443 karimengineer   11u  IPv4  89313      0t0  TCP localhost:8000 (LISTEN)

alternative 5:

sudo service apache2 status
● apache2.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

So I'm asking how the system is listening on localhost ?

and does PHP has its own integrated web server or what ?


回答1:


Yes, PHP has a built in server since v5.4. But you should only use it for development & testing, not in production.

More info: http://php.net/manual/en/features.commandline.webserver.php



来源:https://stackoverflow.com/questions/49891637/does-php-has-its-own-web-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!