N
N
Nikita Shchypylov2016-03-20 00:28:14
PHP
Nikita Shchypylov, 2016-03-20 00:28:14

What is a resource for a beginner to get acquainted with the server part?

Hello
I am a layout designer, but I want to understand servers and how they are arranged
I read a little bit on the Internet in fragments and my head went around - Unix, Apache, and so on
. Can you please tell me a good book about how all this is interconnected? SQL, PHP, server
Thank you

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Philipp, 2016-03-20
@Nikulio

You don't need a book, you need it here: phpfaq.ru/newbie/na_tanke
And everything is so simple, there is Linux - it is an operating system, the same as Windows, or Mac OS, or FreeBSD or 1000 more different options.
I have a web server like apache or nginx. Their task is to accept a request from the user (from the browser), process it somehow and send a response back to the user. Most often this happens over the http protocol.
Now let's look at the request processing in more detail, let's say url example.com/index.html, then the web server sees that the file /index.html is requested, goes to the directory that is the root for the web server (the notorious DOCUMENT_ROOT) and looks for the index.html file in it. If there is such a file, then the web server opens this file and starts reading it and sending it back to the user's browser. This is what happens with pictures.
It becomes much more interesting when the user requests the index.php view file. Then the server (for example, apache) sees that this file is not simple, but a file of a special type (roughly speaking, PHP type), and it must be processed in a special way, so a link to the file is passed to the PHP language interpreter (in the case of apache, this is usually mod_php, with nginx - php-fpm), which in turn opens this file, reads it, turns it into bytecode, and then runs this bytecode. The byte code is executed, generates html and then that html is passed back to the web server, which sends that html to the client's browser.
And the PHP code already contains commands for interacting with the database - the SQL query language. And the database, or rather the database management system (for example, MySQL) is a separate program that can be run on the same machine as the web server.

D
Dark_Scorpion, 2016-03-20
@Dark_Scorpion

The server is essentially a set of programs that listen on a port. As soon as a request comes to it, they return a pre-programmed response.
Install OpenServer on Windows and play around with PHP, you will understand a lot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question