Recently need to do a few PHP project in win, but do not want to build a variety of operating environment in win, just the LAN has a Linux, so the project needs to install the environment on Linux, local win only need a nginx agent can.
Here's how it's implemented:
win:192.168.0.107
linux:192.168.0.108
First, create PHP project directory C:/web under Win, and set as shared folder, share name as Web
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/93/wKioL1WiG1_DOHyiAAHhF3jpVBQ319.jpg "title=" 11111. PNG "alt=" wkiol1wig1_dohyiaahhf3jpvbq319.jpg "/>
Second, login Linux to mount the win shared directory to/mnt/web
Mount-t CIFS//192.168.0.107/web/mnt/web-o Username=jxh,password=jxh,noserverinfo
Third, modify the PHP-FPM monitoring IP and port
Vim/usr/local/webserver/php/etc/php-fpm.conflisten = 192.168.0.108:9000 #默认的127.0.0.1:9000 does not support remote access
Iv. configuring Nginx on Win
server { listen 80; server_name localhost; location / { root C:/web; index index.html index.htm; } error_page 500 502 503 504 / 50x.html; location = /50x.html { root html; } location ~ \.php$ { root /mnt/web; fastcgi_pass 192.168.0.108:9000; fastcgi _index index.php; fastcgi_ param script_filename /mnt/web$fastcgi_script_name; include fastcgi_params; }}
Start Nginx, use localhost to access PHP code in c:/web/
This article is from the "Creep Yuri" blog, make sure to keep this source http://87453343.blog.51cto.com/8606892/1673433
Mount the win shared directory to Linux using remote php-cgi to debug local code