ibaobei 发表于 2016-12-25 10:15:19

CodeIgniter简称ci在nginx下无法运行的问题

  linux服务器下,nginx1.5+php的环境使用ci无法访问指定控制器,只能访问默认的控制器
  解决方法:修改nginx配置文件。在server层里修改一下内容
  location ~ .*\.(php|php5)
  #有的是location ~ \.php$,有的是location ~ .*\.(php|php5)?$。根据具体情况而定,去掉?和$
  {
  #fastcgi_pass  unix:/tmp/php-cgi.sock;
  fastcgi_pass  127.0.0.1:9000;
  fastcgi_index index.php;
  fastcgi_split_path_info ^(.+\.php)(.*)$;      #添加  这一句
  fastcgi_param PATH_INFO $fastcgi_path_info;      #添加  这一句
  include fastcgi.conf;
  }
  保存后上传到服务器,测试
  /alidata/server/nginx/sbin/nginx -t,测试成功后重启nginx
  /alidata/server/nginx/sbin/nginx -s reload
  我不敢保证试用与所有nginx服务器,因为有可能还有其他因素导致失败。我只能说适用与我自己的情况
页: [1]
查看完整版本: CodeIgniter简称ci在nginx下无法运行的问题