配置MNPP nginx.conf以使用Codeigniter / PHP

我有一个标准的Codeigniter安装,但似乎无法获得 MNPP(MySQL + Nginx + PHP + Python)来识别它。 我看到MNPP的公共文件夹中有一个codeigniter配置但是无法让MNPP使用这些设置。</ p>

我已经让我的Codeigniter应用程序在EC2实例上使用Nginx工作 所以它对我的Codeigniter应用程序来说不是问题。</ p>

我也可以在MNPP上提供PHP页面,做MySQL和memcache,所以这些也不是问题。 可能有人建议指点我正确的方向吗?</ p>

仅供参考,这是我的MNPP /Applications/MNPP/conf/nginx/nginx.conf文件: https://gist.github.com/3711660
为了简单起见,我已配置为仅包含我的/ Applications / MNPP / conf / nginx / sites-enabled / default file: https://gist.github.com/3711653 </ p>
</ div>

展开原文

原文

I have a standard Codeigniter installation but can't seem to get MNPP (MySQL+Nginx+PHP+Python) to recognize it. I saw there is a codeigniter config in MNPP's common folder but can't get MNPP make use of those settings either.

I've gotten my Codeigniter app to work using Nginx on an EC2 instance so its not a problem with my Codeigniter app.

Also I can serve PHP pages, do MySQL and memcache on MNPP so those aren't the issue either. Might one suggest something to point me in the right direction?

FYI, here's my MNPP /Applications/MNPP/conf/nginx/nginx.conf file: https://gist.github.com/3711660 which for the sake of simplicity I have configured to ONLY include my /Applications/MNPP/conf/nginx/sites-enabled/default file : https://gist.github.com/3711653

1个回答



哇,这很简单。 我回答了自己的问题。</ p>

在我的“/ Applications / MNPP / conf / nginx / sites-enabled / default”文件中,我需要做的就是切换index.html的顺序和 index.php b / c nginx首先尝试提供index.html,而b / c有一个index.html页面,它从未见过我的codeigniter app PHP页面。</ p>

所以改变这个:</ p>

  location / {
root / Applications / MNPP / Library / nginx / html;
index index.html index.php index.htm;
}
</ code> </ pre>

到此:</ p>

  location / {
root / Applications / MNPP / Library / nginx / html;
index index.php index.html index.htm;
}
</ code> </ pre>

是有用的。</ p>
</ div>

展开原文

原文

Wow, that was simple. I answered my own question.

In my "/Applications/MNPP/conf/nginx/sites-enabled/default" file all I need to do was switch the order of index.html and index.php b/c nginx was trying to serve index.html first and b/c there was an index.html page that was served and it never saw my codeigniter app PHP pages.

So changing this:

location / {
    root   /Applications/MNPP/Library/nginx/html;
    index  index.html index.php  index.htm;
}

to this:

    location / {
    root   /Applications/MNPP/Library/nginx/html;
    index  index.php index.html index.htm;
}

is what worked.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐