F
F
fakz92020-07-06 17:19:30
PHP
fakz9, 2020-07-06 17:19:30

How does php accept and process requests?

I am writing a simple http server with php support. I don’t understand how it is possible to pass the request and its arguments to the puff interpreter. In the sense that it's easy to get the generated page, it's enough just to write "php filename.php" on the command line, and at the output I get a ready-made html code, which I can later pass to the user. But what to do if the code the values ​​from the POST/GET request should be used, how can it be passed to php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nokimaro, 2020-07-06
@nokimaro

A typical bundle for PHP is
nginx (web server) + php-fpm (FastCGI Process Manager)
That is, you can use the standard FastCGI protocol for communication.
Well, maybe you are reinventing https://github.com/spiral/roadrunner
upd. article on the topic of the question - https://habr.com/ru/post/472190/

R
Rajab Magomedov, 2020-07-06
@radhab20

Just install any local server like xampp , run your script through it. There will be something like localhost/test1 or just test1/ (without localhost), depending on how you set it up. Then you can pass your parameters, for example like this (GET):
test1?id=10&sort=5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question