How to start a simple WEB server that can execute cgi of php and python

The following commands can be used if python or php is installed.

The directory where you executed the command will be webroot.

python

For python3

command


python -m http.server --cgi 8000

For python2

command


python -m CGIHTTPServer 8000

php

php5.4〜

command


php -S localhost:8000

If neither python nor php specify a port number, 8000 is assigned by default.

Recommended Posts

How to start a simple WEB server that can execute cgi of php and python
How to set up a simple SMTP server that can be tested locally in Python
Start a simple Python web server with Docker
Introduction and usage of Python bottle ・ Try to set up a simple web server with login function
I want to pass an argument to a python function and execute it from PHP on a web server
[Python] How to create a local web server environment with SimpleHTTPServer and CGIHTTPServer
[Mac] I want to make a simple HTTP server that runs CGI with Python
Launch a simple WEB server that can check the header
How to specify a public directory Python simple HTTP server
How to write a metaclass that supports both python2 and python3
How to start the PC at a fixed time every morning and execute the python program
[Python] A program to find the number of apples and oranges that can be harvested
Overview of how to create a server socket and how to establish a client socket
Verification of how to periodically execute a script on a Linux server on Windows
A simple example of how to use ArgumentParser
Launch a web server with Python and Flask
Put Docker in Windows Home and run a simple web server with Python
How to install a Python library that can be used by pharmaceutical companies
A simple Python HTTP server that supports Range Requests
How to write a list / dictionary type of Python3
[Python] How to write a docstring that conforms to PEP8
[Python] How to split and modularize files (simple, example)
How to create a simple TCP server / client script
How to execute a command using subprocess in Python
How to execute a schedule by specifying the Python time zone and execution frequency
[Python3] Take a screenshot of a web page on the server and crop it further
How to create a USB that Linux and Win10 installer and winpe can boot UEFI
Hello World is a simple web server that follows WSGI (Web Server Gateway Interface) in Python.
[Python] Introduction to web scraping | Summary of methods that can be used with webdriver
Notes on how to use StatsModels that can use linear regression and GLM in python
How to create a property of relations that can be prefetch_related by specific conditions
How to host web app backend processing in Python using a rental server subdomain
[C / C ++] Pass the value calculated in C / C ++ to a python function to execute the process, and use that value in C / C ++.
[Python] How to make a list of character strings character by character
[python] Summary of how to retrieve lists and dictionary elements
How to shuffle a part of a Python list (at random.shuffle)
I want to start a lot of processes from python
[Python] How to delete rows and columns in a table (list of drop method options)
[Python Kivy] How to create a simple pop up window
[Python] Summary of how to use split and join functions
How to develop in a virtual environment of Python [Memo]
Build a Python environment and transfer data to the server
[Introduction to AWS] A memorandum of building a web server on AWS
Comparison of how to use higher-order functions in Python 2 and 3
How to get a list of built-in exceptions in python
How to execute external shell scripts and commands in python
A Python script that allows you to check the status of the server from your browser
How to insert a specific process at the start and end of spider with scrapy
Overview of Python virtual environment and how to create it
Learn the flow of Bayesian estimation and how to use Pystan through a simple regression model
How to batch start a python program created with Jupyter notebook
How to determine the existence of a selenium element in Python
[Python] How to force a method of a subclass to do something specific
A story that struggled to handle the Python package of PocketSphinx
How to check the memory size of a variable in Python
[Python] How to add rows and columns to a table (pandas DataFrame)
[Python] How to get the first and last days of the month
How to make a surveillance camera (Security Camera) with Opencv and Python
From a book that programmers can learn ... (Python): Review of arrays
How to check the memory size of a dictionary in Python
A quick guide to PyFlink that combines Apache Flink and Python