


Configure wnmp under windows, configure wnmp under windows_PHP tutorial
Configure wnmp under windows, configure wnmp under windows
Recently tried to configure nginx php mysql under windows, summarize it here.
1. Download the windows version of nginx. Official website download address: http://nginx.org/en/download.htm. After downloading, extract it to D:wnmp

2. Configure php
Download the windows version of php, official website download address: http://windows.php.net/download/, php will run in cgi mode, unzip the downloaded php package, and go to the wnmp directory of the D drive (D :wnmp), rename the extracted folder to php5.
Enter the folder and modify the php.ini-development file to php.ini.
Open php.ini and find the following code
extension_dir =<span>"</span><span>./ext</span><span>"</span>更改为extension_dir =<span>"</span><span>D:/wnmp/php5/ext</span><span>"</span>。 <br />;extension=php_mysql.dll 去掉分号<br />;extension=php_mysqli.dll 去掉分号(打开数据库动态链接库)
Then copy the libmysql.dll file in the php5 directory to the C:Windows directory, or set the environment variable path, and then find the following code
;cgi.fix_pathinfo=0 去掉分号并改为 cgi.fix_pathinfo=<span>1</span>
3. Configure nginx
After decompression, open the nginx.conf file in the conf directory and find
location /<span> { root html; index index.html index.htm; } #error_page </span><span>404</span> /<span>404</span><span>.html; # redirect server error pages to the </span><span>static</span> page /<span>50x.html # error_page </span><span>500</span> <span>502</span> <span>503</span> <span>504</span> /<span>50x.html; location </span>= /<span>50x.html { root html; } # proxy the PHP scripts to Apache listening on </span><span>127.0</span>.<span>0.1</span>:<span>80</span><span> # #location </span>~<span> \.php$ { # proxy_pass http:</span><span>//</span><span>127.0.0.1;</span> <span> #} # pass the PHP scripts to FastCGI server listening on </span><span>127.0</span>.<span>0.1</span>:<span>9000</span><span> # #location </span>~<span> \.php$ { # root html; # fastcgi_pass </span><span>127.0</span>.<span>0.1</span>:<span>9000</span><span>; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME </span>/<span>scripts$fastcgi_script_name; # include fastcgi_params; #}</span>
changed to:
location /<span> { root <span>d:/www</span>; //自行设置目录 index index.html index.htm; } error_page </span><span>404</span> /<span>404</span><span>.html; redirect server error pages to the </span><span>static</span> page /<span>50x.html # error_page </span><span>500</span> <span>502</span> <span>503</span> <span>504</span> /<span>50x.html; location </span>= /<span>50x.html { root <span>d:/www</span>; } proxy the PHP scripts to Apache listening on </span><span>127.0</span>.<span>0.1</span>:<span>80</span><span> location </span>~<span> \.php$ { proxy_pass http:</span><span>//</span><span>127.0.0.1;</span> <span> } pass the PHP scripts to FastCGI server listening on </span><span>127.0</span>.<span>0.1</span>:<span>9000</span><span> location </span>~<span> \.php$ { root <span>d:/www</span>; fastcgi_pass </span><span>127.0</span>.<span>0.1</span>:<span>9000</span><span>; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME <span>$document_root</span></span><span>$fastcgi_script_name; include fastcgi_params; }</span>
Save configuration file.
4. Run nginx and php
Enter command:
D:\wnmp\php5>php-cgi.exe -b <span>127.0</span>.<span>0.1</span>:<span>9000</span> -c D:/wnmp/php5/php.ini
Run php in cgi mode and listen to the data sent by nginx from port 9000. Double-click nginx.exe to run nginx.
Quick startup settings: First download the file RunHiddenConsole.exe and put it into the nginx directory, then save the following code as start_nginx.bat
<span>@echo off </span><span>set</span> php_home=../php5/ <span>set</span> nginx_home=./<span> echo Starting PHP FastCGI... RunHiddenConsole </span>%php_home%/php-cgi.exe -b <span>127.0</span>.<span>0.1</span>:<span>9000</span> -c %php_home%/<span>php.ini echo Starting nginx... RunHiddenConsole </span>%nginx_home%/nginx.exe -p %nginx_home%<span> exit</span>
Save the following code as stop_nginx.bat
<span>@echo off echo Stopping nginx... taskkill </span>/F /IM nginx.exe ><span> nul echo Stopping PHP FastCGI... taskkill </span>/F /IM php-cgi.exe ><span> nul exit</span>
The final file looks like this. Double-click start_nginx.bat to start nginx and php.
5. Install and configure mysql Download mysql: http://dev.mysql.com/downloads/mysql/, and then extract it to the D:/mnmp directory Found in my-default.ini
basedir=<span>C:\Program Files\MySQL\ </span>去掉#<span>(mysql所在目录)<br />datadir</span>=C:\Program Files\MySQL\data 去掉#(mysql所在目录\data)
Command line to enter the directory: cd C:Program FilesMySQLbin, enter the following command to install mysql: mysqld -install (can be found in the service after installation)
Start the service: net start mysql, close the service: net stop mysql. It can also be started or shut down in the service.
Add path variable: Add in Computer>Properties>Advanced System Settings>Environment Variables: F:phpenvmysqlbin Login command: mysql -h host ip -u username -p user password 
What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


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

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

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