Configure the server's PHP environment under windows-server. It is recommended to choose php+apache or php+iis.

WBOY
Release: 2016-08-04 09:21:13
Original
1252 people have browsed it

I am planning to configure the php5.6 environment on the server recently, so I would like to ask for suggestions on which kind of web server is better, in terms of performance and security. Thanks!

Reply content:

I am planning to configure the php5.6 environment on the server recently, so I would like to ask for suggestions on which kind of web server is better, in terms of performance and security. Thanks!

For high concurrency and high performance, nginx+php is suitable;
If you want stability, modules, and rewrite, apache+php is more suitable;

It’s okay if it’s safe;
nginx is the trend;

You mean iis? Well; just take a look at this thing with the interest of studying history; don’t use it for production;

Finally; it is not recommended to run php in a windows environment at all; in terms of network services, Linux is the first choice;

Recommended IIS + PHP

  1. It is not recommended to use Apache under Windows. There are a lot of pitfalls. On some machines, you may need to change the configuration file to improve concurrency (if you don’t change it, the user will not be able to access the third page after opening two pages at the same time)

  2. If you have a relatively new Windows Server, you can consider IIS. I don’t remember which version of IIS since then, but the performance of IIS + PHP can match or even surpass nginx

P.S. If you don’t have to, I still recommend you to use Linux. It is estimated that most PHP programmers test under Linux, and it is easier to get started with the environment and operation and maintenance is also simple

(The learning cost of Windows Sever is really a bit high. If you just connect to it remotely and use it as the Desktop version, then please ignore my words)

For windows, it is recommended to use IIS and win your own products

I understand what you mean. To build a server, you need to use linux plus php plus nginx, which saves resources and has high performance and high concurrency

Comparison of IIS and Apache performance tests on Windows 7
Environment (64-bit Win7): IIS7+PHP5.4 (NTS non-thread-safe version) vs Apache2.4 (32-bit)+PHP5.4

Static file processing:
ab -k -c100 -n10000 http://127.0.0.1/info.htm # IIS RPS 1709
ab -k -c100 -n10000 http://127.0.0.1:8080/info.htm # Apache RPS 1847
Conclusion: Apache based on APR runtime and WinNT multi-threading is no worse than IIS in static resource processing.

PHP file processing:
ab -k -c100 -n10000 http://127.0.0.1/bs.php # IIS RPS 1180
ab -k -c100 -n10000 http://127.0.0.1:8080/bs.php # Apache RPS 1071
Conclusion: Apache uses threaded MPM, so it needs to use a thread-safe version of PHP. The thread-safety check has a certain overhead, so the performance is lower than IIS+PHP-CGI.

It is recommended to use a solution that you are familiar with. Personally, I am more familiar with Apache. The configuration is not much different from that on Linux. Rewrite data is also easier to find. Of course, if you are on Linux, you can consider using it. Nginx/PHP-FPM combination.

It is recommended to throw away Windows Server, it consumes too many resources and is unsafe. Using Linux with high security is the right solution!

Related labels:
source:php.cn
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!