简体   繁体   English

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

[英]Configuring MNPP nginx.conf to work with Codeigniter/PHP

I have a standard Codeigniter installation but can't seem to get MNPP (MySQL+Nginx+PHP+Python) to recognize it. 我安装了标准的Codeigniter,但似乎无法让MNPP(MySQL + Nginx + PHP + Python)识别它。 I saw there is a codeigniter config in MNPP's common folder but can't get MNPP make use of those settings either. 我看到MNPP的common文件夹中有一个codeigniter配置,但也无法使MNPP使用这些设置。

I've gotten my Codeigniter app to work using Nginx on an EC2 instance so its not a problem with my Codeigniter app. 我已经使我的Codeigniter应用程序可以在EC2实例上使用Nginx正常工作,因此Codeigniter应用程序不是问题。

Also I can serve PHP pages, do MySQL and memcache on MNPP so those aren't the issue either. 我也可以提供PHP页面,在MNPP上执行MySQL和memcache,所以这些也不是问题。 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 仅供参考,这是我的MNPP /Applications/MNPP/conf/nginx/nginx.conf文件: https ://gist.github.com/3711660为了简单起见,我将其配置为仅包含我的/ Applications / MNPP / conf / nginx /启用站点/默认文件: https : //gist.github.com/3711653

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. 在我的“ / Applications / MNPP / conf / nginx / sites-enabled / default”文件中,我要做的就是切换index.html和index.php的顺序b / c nginx试图先提供index.html和b / c提供了一个index.html页面,但从未看到我的codeigniter应用程序PHP页面。

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. 是有效的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM