美文网首页
Phalcon新建项目报错Mod-Rewrite is not

Phalcon新建项目报错Mod-Rewrite is not

作者: Iris_Yzy | 来源:发表于2018-11-01 10:51 被阅读0次

    环境:Nginx+PHP7

    进入配置文件
    $ vim /usr/local/etc/nginx/nginx.conf

    找到location / {location ~ \.php$ {
    配置如下:

    root后面是项目的绝对路径,把root提出来下面👇的location ~ \.php$ {就可以注释掉root

    root   /Users/yuanzi/PhpstormProjects/demo_phalcon/public;
    location / {
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php?_url=$uri&$args;
    }
    
    location ~ \.php$ {
    #   root    html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }   
    

    最后重新加载nginx配置:sudo nginx -s reload

    屏幕快照 2018-11-01 上午10.17.52.png

    Success!~

    相关文章

      网友评论

          本文标题:Phalcon新建项目报错Mod-Rewrite is not

          本文链接:https://www.haomeiwen.com/subject/nxbtxqtx.html