In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Most people do not understand the knowledge points of this article "how to build Nginx and multi-version PHP coexistence in Windows environment", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to build Nginx and multi-version PHP coexistence in Windows environment" article.
Software download address
Php integrated with nginx requires an installation-free version of Non Thread Safe (nts).
Download NGINX. This example downloads nginx/Windows-1.10.2. Download it and decompress it.
Download PHP7.0. This example downloads PHP 7.0,0.14) VC14 x64 Non Thread Safe. Download it and decompress it.
Download PHP5.2. This example downloads php-5.2.17-nts-Win32-VC6-x86.zip. Download it and decompress it.
RunHiddenConsole, which is used to start php-cgi, can close the window and still run in the background. After unpacking, copy RunHiddenConsole.exe to the root directory of nginx (the directory where the nginx.exe file is located).
Configure NGINX
Modify the nginx.conf configuration file. Send the request to ports 9000 and 9001, respectively.
Server {listen 80; server_name www.mydomain.com; location / {root Drexel PHP programmer; index index.php index.html index.htm;} location ~\. Php$ {root Dorex PHP programmer; fastcgi_pass 127.0.0.1 server_name www.mydomain.com; location 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $programmer Include fastcgi_params;}} server {listen 80; server_name www.mydomain1.com; location / {root Dazzle pedigree phptom program1; index index.php index.html index.htm;} location ~\. Php$ {root dvade pedigree phptom program1; fastcgi_pass 127.0.0.1 guanza 9001; fastcgi_index index.php Fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;}} configure PHP
Copy php.ini-recommended or php.ini-development to php.ini.
; set the ext path of php, usually an absolute path is required. Extension_dir = "D:/php-5.2.17-nts-Win32-VC6-x86/ext"; maximum limit for submitting data post_max_size = 30m; maximum limit for uploading files. Upload_max_filesize = 100m; usually the extension to be enabled, php7.0 does not have php_mysql.dll and php_pdo.dll, so there is no need to enable these two items. Extension=php_gd2.dllextension=php_mbstring.dllextension=php_mysql.dllextension=php_mysqli.dllextension=php_pdo.dllextension=php_pdo_mysql.dll;php and nginx integration must enable cgi.fix_pathinfo=1 startup script
Create a new startup script start_nginx.bat in the nginx root directory (where the nginx.exe file is located). The two versions of php use different ports.
@ ECHO OFFECHO Starting PHP5.2 FastCGI...RunHiddenConsole.exe D:/php-5.2.17-nts-Win32-VC6-x86/php-cgi.exe-b 127.0.0.1:9000ECHO Starting PHP7.0 FastCGI...RunHiddenConsole.exe D:/php-7.0.14-nts-Win32-VC14-x64/php-cgi.exe-b 127.0.0.1:9001ECHO Starting Nginx...start nginx
Create a new shutdown script stop_nginx.bat in the nginx directory. Two php-cgi can be turned off with a single command.
@ ECHO OFFECHO Stoping PHP FastCGI...taskkill / F / IM php-cgi.exe > nulECHO Stoping Nginx...taskkill / F / IM nginx.exe > nul is the content of this article on "how to build the coexistence of Nginx and multi-version PHP in Windows environment". I hope you all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to learn more about it, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.