[PHP first] PHP + nginx + windows first attempt

Source: Internet
Author: User
[Article 1 of PHP learning] PHPnginxwindows was originally intended for JAVA Development. The company will add Community functions to the P2PP2C system in the future. The crowdfunding system is also developed by PHP, so I decided to learn PHP. Not to mention nonsense. Go to the subject and download eclipseideforphpjavass4.4nginx1.7.1php5.3.5 to start php.

[Article 1 of PHP learning] PHPnginxwindows was originally intended for JAVA Development. The company will add Community functions to the P2PP2C system in the future. The crowdfunding system is also developed by PHP, so I decided to learn PHP. Let's not talk about it. Go to the subject and download: Eclipse IDE for PHP developers 4.4 nginx1.7.1 PHP5.3.5 to start php.

[PHP first] PHP + nginx + windows first attempt

The company will add Community functions to the P2P and P2C systems in the future. The crowdfunding system is also developed by PHP, so I decided to learn about PHP.

Not much nonsense. Go to the subject and download:

Eclipse IDE for PHP developers 4.4

Nginx1.7.1

PHP5.3.5

Start the php-cgi script (start-phpcgi.bat) as follows:

@echo offe:cd E:\tools\php-5.3.5echo "php-cgi is starting on 9000 port"php-cgi.exe -b 127.0.0.1:9000
Configure php. ini


Nginx script configuration

@echo offE:\tools\nginx-1.7.1\nginx.exepause

Nginx: [alert] cocould not open error log file: CreateFile () "logs/error. log" failed (3: The system cannot find the path specified)
16:57:56 [emerg] 14312 #10088: CreateFile () "C: \ Users \ [UserName]/conf/nginx. conf" failed (3: The system cannot find the path specified)

When the above nginx script is started, an error is reported: the log file cannot be found, and the modification is as follows:

@echo offe:cd E:\tools\nginx-1.7.1echo "nginx is starting on port 80"nginx.exepause
After you close the command line, open the task manager to manually kill the nginx process.

The nginx. conf file is as follows:

Worker_processes 1; events {worker_connections 1024;} http {include mime. types; default_type application/octet-stream; sendfile on; # log configuration-remove the following three lines of log_format access' $ remote_addr-$ remote_user [$ time_local] "$ request" ''$ status $ body_bytes_sent" $ http_referer "'' "$ http_user_agent "$ http_x_forwarded_for '; access_log logs/access. log access; error_log logs/nginx_error.log debug; keepalive_timeout 65; server {listen 80; # Set the nginx listening port to 80 server_name localhost; charset UTF-8; # default file encoding location/{root D:/www; # change it to your own virtual directory. Note that! Nginx1.3.7 and earlier versions do not support space in the file path or Chinese !!! I don't know if this version is supported, but it is not supported below ...... Although Apache supports ...... Index index.html index.htm index. php; # note that index is added here. php. If this parameter is not added, the error 403 may be reported. If this parameter is set to Windows, linux or other systems, it is unknown. Autoindex on; # list the directory tree structure if the file does not exist} location ~ \. Php $ {fastcgi_pass 127.0.0.1: 9000; # fastcgi listening port, which must be consistent with the fastcgi_index index specified during cgi startup of php. php; # default homepage fastcgi_param SCRIPT_FILENAME D:/www $ fastcgi_script_name; # the startup path: /www "is changed to your installation path to include fastcgi_params ;}}}
Start
Start-phpcgi.bat

Start-nginx.bat

Access: http: // 127.0.0.1/hello-php/hello. php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.