2
votes

I built a website in CodeIgniter in my local machine with Apache. 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. 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/.

Now when I try to access my website under that URL, I get 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. It was just the default 80.

Does anybody have a suggestion for this problem?

1
A port number in base_url should not break the site. Does a regular simple <?php phpinfo(); work on the new IIS site? - Joachim Isaksson
no. I created a test.php page on the root folder, and I cannot get to that page also. giving me the same error 500 - Rachid
500 would seem to indicate that PHP is installed, but not working. - Joachim Isaksson
I have multiple php websites on the server running without any problems. But the difference is that I have multiple ip addresses for the server, and the websites are using port 80. I even tried to access a test.html page on the root and I still got the 500 error. - Rachid
Tell your IIS to listen on *.81 and forward all those requests to this website's root. I'm not sure but I think you could even leave out the port number in config.php: - qwertzman

1 Answers

0
votes

Thank you very much for your help. I found the solution. Joachim Isaksson was right about php not installed. when I created the website on iis, I thought php was added to the website automatically, but I was wrong. 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. and the problem was solved.

Thank you guys again