问题
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