nginxコードイグナイターの設定

WBOY
リリース: 2016-07-28 08:27:52
オリジナル
1018 人が閲覧しました

nginx-1.10

codeigniter-3.0

1。 nginx.conf

server {
listen 80;
server_name localhost;  <--------こちら
root D:/wnmp/www;  <------ ここ
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#root D:/wnmp/www;
#indexindex.htmlindex .htm;
try_files $uri $uri/ /index.php;   <------ ここ
}
#error_page 404 /404.html;
# サーバーエラーページを静的ページ /50x.html にリダイレクトします
#
error_page 500 2 503 504 /50x.html;
場所= /50x.html {
root html;
}
# 127.0.0.1:9000 でリッスンしている FastCGI サーバーに PHP スクリプトを渡します
#
location ~ .php$ {
#root D:/wnmp/www;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME D:/wnmp/www/index.php;   <------------- こちら
fastcgi_param PATH_INFO $fastcgi_path_info;   <------------- こちら
fastcgi_split_path_info ^(.+.php)(.*)$;  <------------- こちら
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;  <------------- ここに
fastcgi.conf を含める;   <------------- こちら
}
}

2. Index.php

解压codeigniter,重命名ci,放在d:/wnmp下

掴ci下的index.php移动到网站根目录d:/wnmp/www下

index.php構成

$system_path = 'D:/wnmp/ci/system';

$application_folder = 'D:/wnmp/ci/application';

$view_folder = '';

3. config.php

ci/application/config/config.php

$config['base_url'] = 'http://localhost/';

$config['index_page'] = '';

$config ['uri_protocol'] = 'REQUEST_URI';

重启nginx、完了。
以上、nginx codeigniter の構成について説明しましたが、側面の内容も含まれており、PHP 教則に関心のある友人の助けになることを望みます。

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!