Fatal Error when adding libraries (Solved) |
[eluser]sagarv[/eluser]
Hi, I am new to CI, I have installed the system and everything seems to be working fine. However each time I try to install a 3rd party library, I get some sort of fatal or parse error like below: http://mydiscobox.com/account/ I've tried to install all three of these and all encounter a fatal/parse error of some sort (I dont modify the files at all) - Tank_Auth - Ion_Auth - UhOh It seems to have issues loading the libraries I have this controller working which doesnt use an add-on library so I'm not sure what the problem is http://mydiscobox.com/account/ Can anyone help!? Thanks !!
[eluser]Prophet[/eluser]
Could you post the code around line 15 of account.php? The error means you are trying to do something like.. Code: $foo->function() var_dump($foo) and print_r($foo) are useful for debugging things like this.
[eluser]sagarv[/eluser]
Hi, the code at line 15 is: Code: if (!$this->tank_auth->is_logged_in()) { Here is the whole file, it is from Tank_Auth (I haven't modified it at all) Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Thanks for your help
[eluser]Prophet[/eluser]
Make sure that tank_auth is actually loaded. Code: $this->load->library('tank_auth'); You can also put tank_auth into the $autoload['libraries'] array in config/autoload.php.
[eluser]Jelmer[/eluser]
It's strange, your code should fail much sooner. The first line loading the parent constructor is impossible: Code: parent::__construct(); Code: parent::Controller(); Try this: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
[eluser]sagarv[/eluser]
Hi guys, thanks for the help, I've tried that code and am now seeing a parse error. This is the same parse error I got when I installed Ion Auth and UhOh, there are no parse errors any of the files as I'm using yet they keep showing up so I can't get anything working http://mydiscobox.com/account/ I have another controller here which doesn't use any 3rd party files which seems to work http://mydiscobox.com/signup/
[eluser]sagarv[/eluser]
Here is the Tank_Auth.php file, line 24 Code: private $error = array(); Code: { etc..
[eluser]Prophet[/eluser]
[quote author="Jelmer" date="1280131950"]It's strange, your code should fail much sooner. The first line loading the parent constructor is impossible: Code: parent::__construct(); Code: parent::Controller(); Does PHP not automagically find function Controller() when __construct() is called?
[eluser]sagarv[/eluser]
Hey guys, after a bit of digging I've found my webserver was using PHP4, I changed it to PHP5 and everything seems to be working now! Thanks for your help! :cheese: |
Welcome Guest, Not a member yet? Register Sign In |