CodeIgniter Forums
500 - Internal server error when including library in my controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: 500 - Internal server error when including library in my controller (/showthread.php?tid=59144)



500 - Internal server error when including library in my controller - El Forum - 08-29-2013

[eluser]Computerzworld[/eluser]
Hello,
I am trying to include library in my controller but it gives me 500 internal server error. however its working fine on my localhost & one another server. What could be the problem behind this error? Please help me. Thanks in advance.


500 - Internal server error when including library in my controller - El Forum - 08-29-2013

[eluser]CroNiX[/eluser]
Do you just want us to guess? There's no real way to answer that without seeing the code. What do your error logs say?


500 - Internal server error when including library in my controller - El Forum - 08-31-2013

[eluser]gummiforweb[/eluser]
500 between localhost / real host are usually cause by these:

1) .htaccess file
2) php version/settings

However, as CroNiX said, there's no way we can tell without seeing anything (code? error log? server setting .etc)


500 - Internal server error when including library in my controller - El Forum - 09-01-2013

[eluser]Computerzworld[/eluser]
Thanks for the reply. This is my htaccess file.
Code:
RewriteEngine on
AddType application/x-shockwave-flash .swf
#RewriteBase /
RewriteCond $1 !^(index\.php|resources|robots\.txt|flash)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

I am using CI 2.1.4. My library file name is MycustomLib.php and here is my controller's code for including & calling library function.


Code:
$this->load->library('MycustomLib');
$this->mycustomlib->dateDiff($eDate, $sDate);
When I am commenting out this code, it works fine.

Please let me know if you need anything else from my side.

Thanks.


500 - Internal server error when including library in my controller - El Forum - 09-02-2013

[eluser]InsiteFX[/eluser]
If runing on a live server make sure the filename is all lowercase and also when you define it in your load.