简体   繁体   English

带端口号的CodeIgniter base_url

[英]CodeIgniter base_url with port number

I built a website in CodeIgniter in my local machine with Apache. 我使用Apache在本地计算机的CodeIgniter中建立了一个网站。 The website works fine. 该网站运行良好。 Then I moved it to IIS in the same machine and converted the htaccess to web.config, and the website still works fine with no problems. 然后,我将其移至同一台计算机上的IIS,并将htaccess转换为web.config,该网站仍然可以正常运行,没有任何问题。 Then I moved my website to an IIS remote server in the same network, created a new site in IIS and set it up on port 81. Then I modified the base_url in the config file in CodeIgniter to http://192.168.1.40:81/ . 然后,我将网站移到同一网络中的IIS远程服务器上,在IIS中创建一个新站点并在端口81上进行设置。然后,我将CodeIgniter中配置文件中的base_url修改为http://192.168.1.40:81/

Now when I try to access my website under that URL, I get 500: Internal server error . 现在,当我尝试使用该URL访问网站时,出现500:Internal server error

I'm not sure what's causing the problem. 我不确定是什么引起了问题。 The only cause I can think of is the port number in the URL because the website was working in my local IIS, but there was no port number in the URL or base_url. 我能想到的唯一原因是URL中的端口号,因为该网站在我的本地IIS中运行,但是URL或base_url中没有端口号。 It was just the default 80. 它只是默认值80。

Does anybody have a suggestion for this problem? 有人对这个问题有建议吗?

Thank you very much for your help. 非常感谢您的帮助。 I found the solution. 我找到了解决方案。 Joachim Isaksson was right about php not installed. Joachim Isaksson对未安装php是正确的。 when I created the website on iis, I thought php was added to the website automatically, but I was wrong. 当我在iis上创建网站时,我认为php是自动添加到该网站的,但是我错了。 You need to add php to every new site you create in iis (if i'm wrong, please tell me how to set up php to be added automatically when a new site is created in iis.) Then I installed the url_rewrite in iis. 您需要将php添加到在iis中创建的每个新站点中(如果我错了,请告诉我如何设置在iis中创建新站点时自动添加的php。)然后,我在iis中安装了url_rewrite。 and the problem was solved. 问题解决了。

Thank you guys again 再次谢谢你们

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

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