PHP+微信小程序解决方案运行环境搭建

Php微信小程序解决方案运行环境搭建推荐使用PHPSTUDY,该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有32M,有专门的控制面板。总之学习PHP 只需一个包。

官方下载地址:http://www.phpstudy.net/phpstudy/phpStudy20161103.zip

手工配置对学习PHP的新手来说,WINDOWS下环境配置是一件很困难的事;对老手来说也是一件烦琐的事。因此无论你是新手还是老手,该程序包都是一个不错的选择。
全面适合 Win2000/XP/2003/win7/win8/win2008 操作系统 ,支持Apache、IIS、Nginx和LightTPD。

一键切换版本

Apache环境配置站点配置


< VirtualHost *:80>
    DocumentRoot "F:\code\php\diygw"
    ServerName xcx.diygw.com
    ServerAlias 
  < Directory "F:\code\php\diygw">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  < /Directory>
< /VirtualHost>



如果APACHE出现重定向加载出错的问题

1、httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2、修改php.ini
找到
; cgi.force_redirect = 1
去掉前面分号,把后面的1改为0

cgi.force_redirect = 0


Nginx环境配置


server {
        listen       80;
        charset utf-8;
        server_name  xcx.diygw.com;
        root F:/code/php/diygw;   
        
     	 
    location / {
            index  index.html index.htm index.php;
            if (!-e $request_filename) {  
                   rewrite  ^/(.*)$  /index.php/$1  last;  
                   break;  
                }  
            #autoindex  on;
        }
    		location ~ \.php(.*)$  {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
    		
   			 
			  access_log off;
    }


HOSTS配置

127.0.0.1 xcx.diygw.com