Welcome Guest, Not a member yet? Register   Sign In
500 - Internal server error when including library in my controller
#1

[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.
#2

[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?
#3

[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)
#4

[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.
#5

[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.




Theme © iAndrew 2016 - Forum software by © MyBB