Home > Backend Development > PHP Tutorial > An interesting command: php -S (tip sharing)

An interesting command: php -S (tip sharing)

藏色散人
Release: 2023-04-11 07:30:01
forward
4276 people have browsed it

An interesting command: php -S (tip sharing)

We know that PHP has a built-in http server starting from 5.4.0. Developers can use this built-in server to do some local testing. How is it started?

The startup method is as follows:

php -S ip:port
Copy after login

With this kind of startup, if the service stops after closing the current terminal... What should I do?

Here is a little trick that we can do to turn it into a process that always runs in the background:

nohup php -S ip:port &
Copy after login

The default log is in the current directory, and the default name is nohup. out, you can redirect to other places!

Note that php -S is only suitable for local debugging and cannot be used in production environments.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of An interesting command: php -S (tip sharing). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template