0
votes

I've launched a new AWS Red Hat ec2 instance on the free tier. I've followed this tutorial to set up a LAMP stack http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

And this tutorial to set up CodeIgniter https: //www.rosehosting.com/blog/how-to-install-codeigniter-on-a-linux-vps/

It is worth noting I have not yet purchased a domain name, I am simply hitting the website via the elastic IP I set up in the AWS console. As such, my base_path is http://xxx.xx.xxx.xxx/

Other than that, everything else has been set up the same as per the two tutorials above. I go to the IP of my website, and it loads the default page.

I have set the database to auto load and it connects without issue. I also auto load the url libraries. I manually load the Dbtest_model model in the Welcome.php controller without issue, but when I call the function to get all from the database and pass it to the view as an array, the view displays an error stating my $data variable is undefined and traces it back to this;

File: /var/www/codeigniter/index.php

        Line: 315

        Function: require_once          

That error refers to require_once BASEPATH."core/CodeIgniter.php";

I have checked /var/www/codeigniter/system/core/CodeIgniter.php and it is present and permissions are appropriately set on the file and the folders/subfolders

I echo out my BASEURL which produces /var/www/codeigniter/system/

I am at a loss as to why code igniter works, i can load 3 different view files, but I can't load models/query the database

Any ideas?

1

1 Answers

1
votes

If your controller class contains the __construct() or __destruct method, remove that method. Else, try removing certain functions. Back up your code before trying to do so. Hope this helps.