Which servers can php be deployed to?
php can be deployed on 2 types of web servers: 1. apache, an open source web server of the Apache Software Foundation, can run on most computer operating systems, due to its multi-platform and security It is widely used; 2. nginx is a high-performance HTTP and reverse proxy web server, and also provides "IMAP/POP3/SMTP" services.
The operating environment of this tutorial: Windows 7 system, PHP version 8.1, DELL G3 computer
Commonly used web servers for php are generally Two types:
apache
nginx
LAMP (linux apache mysql php ) and LNMP (linux ngnix mysql php) are currently the most commonly used PHP environment architectures for servers.
apache server
Apache HTTP Server (referred to as Apache) is an open source web server of the Apache Software Foundation that can be used on most It runs on computer operating systems and is widely used due to its multi-platform and security features. It is one of the most popular web server-side software. It is fast, reliable and extensible through a simple API to compile interpreters such as Perl/Python into the server.
Apache is a popular open source, cross-platform web server, and it is also the most popular web server in existence.
Apache HTTP server is a modular server, derived from NCSAhttpd server. After many modifications, it has become the world's number one web server software.
It can run on almost all widely used computer platforms.
Apache originated from the NCSAhttpd server. After many modifications, it has become one of the most popular web server software in the world. Apache is taken from the pronunciation of "a patchy server", which means a server full of patches. Because it is free software, people are constantly developing new functions and features for it, and modifying the original defects. Apache is characterized by simplicity, fast speed, stable performance, and can be used as a proxy server.
Originally it was only used for small or experimental Internet networks, and later gradually expanded to various Unix systems, especially the support for Linux is quite perfect. Apache has a variety of products that can support SSL technology and multiple virtual hosts. Apache is a process-based structure. Processes consume more system overhead than threads and are not suitable for multi-processor environments. Therefore, when expanding an Apache website, it is usually necessary to add servers or expand cluster nodes instead of increasing processor. So far, Apache is still the most used web server in the world, with a market share of about 60%. Many famous websites in the world such as Amazon, Yahoo!, W3 Consortium, Financial Times, etc. are products of Apache. Its success mainly lies in its open source code, an open development team, and support for cross-platform applications ( It can run on almost all Unix, Windows, and Linux system platforms) and its portability.
The birth of Apache is very dramatic. When the NCSAWWW server project came to a halt, those using the NCSAWWW server began exchanging patches for the server, and they quickly recognized the need for a forum to manage these patches. In this way, the Apache Group was born, which later created Apache based on NCSA.
Apache web server software has the following features:
1. Supports the latest HTTP/1.1 communication protocol
2. Has a simple and powerful based on File configuration process
3.Support universal gateway interface
4.Support IP-based and domain name-based virtual hosts
5.Support multiple methods of HTTP authentication
6. Integrated Perl processing module
7. Integrated proxy server module
8. Supports real-time monitoring of server status and customized server logs
9. Supports server side Contains instructions (SSI)
10. Supports Secure Socket Layer (SSL)
11. Provides tracking of user session processes
12. Supports FastCGI
13. JavaServlets can be supported through third-party modules
If you are ready to choose a Web server, there is no doubt that Apache is your best choice.
nginx server
Nginx (engine x) is a high-performance HTTP and reverse proxy web server, and also provides IMAP/ POP3/SMTP service. Nginx was developed by Igor Sesoev for the Rambler.ru site (Russian: Рамблер), the second most visited site in Russia. The public version 1.19.6 was released on December 15, 2020.
It releases source code under a BSD-like license and is known for its stability, rich feature set, simple configuration files and low system resource consumption. On January 25, 2022, nginx 1.21.6 was released.
Nginx is a lightweight web server/reverse proxy server and email (IMAP/POP3) proxy server, released under the BSD-like protocol. Its characteristics are that it occupies less memory and has strong concurrency capabilities. In fact, nginx's concurrency capabilities perform better among web servers of the same type.
Nginx can be compiled and run on most Unix Linux OS, and there is a Windows ported version. The 1.20.0 stable version of Nginx has been released on April 20, 2021. Under normal circumstances, for new sites, it is recommended to use the latest stable version as the production version. The urgency of upgrading existing sites is not high. Nginx's source code uses a 2-clause BSD-like license.
Nginx is a very powerful, high-performance Web and reverse proxy service. It has many very superior features:
In the case of high concurrency of connections, Nginx is a good alternative to the Apache service. Product: Nginx is one of the software platforms often chosen by bosses in the virtual host business in the United States. Able to support responses of up to 50,000 concurrent connections. Thanks to Nginx for choosing epoll and kqueue as the development model.
What is the difference between apache and nginx:
1. The core difference between the two is that apache is a synchronous multi-process model. A connection corresponds to a process; nginx is asynchronous, and multiple connections can correspond to a process. nginx handles static files well and consumes less memory. But there is no doubt that apache is still the current mainstream and has many rich features, so it still needs to be matched. Of course, if it is determined that nginx meets the needs, then using nginx will be a more economical way.
2. The load capacity of nginx is much higher than that of apache. The latest server also uses nginx. And after changing the configuration of nginx, you can -t test whether there is any problem with the configuration.
3. When apache is restarted and it is found that the configuration is wrong, it will crash. When making changes, you will be very careful. Now there are many cluster sites, the front-end nginx anti-concurrency, the back-end apache cluster, the cooperation is also good.
4. It is useless for nginx to handle dynamic requests. Generally, apache is required to handle dynamic requests. nginx is only suitable for static and reverse requests.
5. From experience, nginx is a very good front-end server with good load performance. With nginx, it is effortless to use webbench to simulate 10,000 static file requests. Apache has good support for languages such as php. In addition, apache has a strong support network. It has been developed longer than nginx and has fewer bugs. However, apache has the disadvantage of not supporting multi-core processing loads. It is recommended to use nginx for the front end and back end. apache. For large websites, it is recommended to use the cluster function of nginx.
6. In most cases, nginx is better than APACHE, such as static file processing, PHP-CGI support, reverse proxy function, front-end Cache, connection maintenance, etc. In Apache PHP (prefork) mode, if PHP processing is slow or the front-end pressure is high, it is easy for the number of Apache processes to surge, resulting in a denial of service.
7. Apache has advantages in processing dynamics. Nginx has better concurrency and low CPU memory usage. If rewrite is frequent, then Apache is the best!
8. Generally speaking, for web services that require performance, use nginx. If you don't need performance and just want stability, then use apache.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of Which servers can php be deployed to?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
