简体   繁体   English

codeigniter项目从iis迁移到apache2

[英]codeigniter project migration from iis to apache2

I have migrated my project from Windows IIS to Mint Apache2. 我已将我的项目从Windows IIS迁移到Mint Apache2。 Unfortunately I am getting an error: 不幸的是我收到了一个错误:

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.

I have changed permissions on the files to 755. Normally if there is a CI error (connecting to db etc) it throws an error. 我已将文件的权限更改为755.通常,如果存在CI错误(连接到db等),则会抛出错误。

I have opened my index.php with VI, and I have noticed ^M on the end of each line in EACH FILE. 我用VI打开了我的index.php,我注意到每个文件在每个文件的末尾都有^ M. This doesn't show in Aptana though. 但这并没有在Aptana中显示出来。 每行末尾的奇怪结局

I have spent last half a year writing this app and I'm not very excited about this. 我花了半年时间编写这个应用程序,我对此并不十分兴奋。 Does anybody have any experience with this? 有没有人有这方面的经验?

Thank you. 谢谢。

If you have access to the shell on your server and it's running Linux/Unix, try this: 如果您可以访问服务器上的shell并运行Linux / Unix,请尝试以下操作:

for i in `find . -type f` ; do dos2unix $i $i; done

The for i in `find . -type f` ; for i in `find . -type f` ; for i in `find . -type f` ; part finds all FILES within the current directory. part查找当前目录中的所有FILES。

Then, do dos2unix $i $i; done 然后, do dos2unix $i $i; done do dos2unix $i $i; done runs dos2unix which will convert all your ^M 's to the Unix standard which is just \\r . do dos2unix $i $i; done运行dos2unix ,它将所有你的^M转换为Unix标准,它只是\\r

If you want to test it out on a single file, make a copy of a file and replace find . 如果要在单个文件上测试它,请复制一个文件并替换find . with find filename.ext find filename.ext

Try adding this to your php.ini. 尝试将此添加到您的php.ini。

display_errors = On

This should show a proper error instead of just throwing a 500. From therein it should be relatively simple to debug. 这应该显示一个正确的错误,而不是只抛出500.从那里它应该是相对简单的调试。

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

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