环境要求

  • 操作系统:windows, linux, mac
  • 运行环境:Apache|Nginx + php5.3+ + mysql5.5+ 推荐使用Nginx,原因你懂的。
  • php扩展:openssl, pdo, mbstring, curl
  • 依赖:herophp/framework
  • composer 1.2.0+

拉取代码

git clone https://git.oschina.net/blackfox/herosphp-app.git

Nginx配置

herosphp-app nginx配置很简单,就是添加一个url重写就好了,将所有的php请求转发到app/index.php, 下面给出一个demo

server {
    listen   80;
    server_name  www.herosphp.my;
    root /php/herosphp-app;
    autoindex on;
    index index.html index.php index.htm;
    #设定本虚拟主机的访问日志
    access_log  /dev/null;
    error_log /dev/null;

    # Make site accessible from http://localhost/

    location ~ .*\.(php|php5)?$
    {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    #add surpport pathinfo visitd mode    
    if (!-f $request_filename) {
           rewrite ^/.*$ /app/index.php last;
           break;
    }

}
Copyright © HerosPHP 2016 all right reserved,powered by Gitbook最后更新时间: 2017-08-07 16:46:36

results matching ""

    No results matching ""