Showing posts with label codeIgniter. Show all posts
Showing posts with label codeIgniter. Show all posts

Tuesday, 11 October 2011

CodeIgniter / Bonfire

I have been progressing an automated way of generating maps from openstreetmap data, allowing layers to be selected, including contours and hill shading etc. (https://github.com/jones139/disrend).

I want a web front end to allow people to generate maps using this renderer.   When I did this for my townguide program I just built a very simple php based web interface.
Ideally I would like things like user authentication though, which would mean writing a lot of code to go with it.
The CodeIgniter framework goes some way to this by providing an interface to sessions etc, but there is still quite a bit of boilerplate code to write to produce the database interface.
The CodeIgniter / Bonfire application seems to solve this by providing:

  1. Roles based authentication.
  2. Modular structure (this was an issue I had with codeigniter - you ended up with code scattered in different places).
  3. A really neat module builder function that produces a basic module with database interface for you to build on.
I am just trying to get the hang of using bonfire now - I have had a few issues with installing modules based on the module builder code - will write up how to do this once I have it working...

Sunday, 3 April 2011

Trouble with mysql, apache, php5 and codeIgniter

I am working on a new web interface to townguide based on php so it can be used on a low cost web hosting service (rendering will be done by a separate computer).
I am going to use the codeIgniter web framework because it seems simple, and is simiar to django, which I was just starting to get used to.....
Alas getting database access working on my laptop for development was difficult.
I have apache, php5 and mysql all working, but whenever I tried to load the database module of codeIgniter I got a 500 Internal Server error, but no errors in either the apache or codeigniter error logs.   This made debugging difficult.
After much searching on the internet I realised it was because I needed to install libapache2-mod-auth-mysql as well as php5-mysql.
Doing sudo apt-get install libapache2-mod-auth-mysql and re-starting apache made the following trivial mysql db connection work:

$conn = mysql_connect('localhost', 'www', '1234');
if($conn) {
  echo 'Finally connected!!!';
 } else {
  die('Still cannot connect' . mysql_error());
 }
?> 
A bit late now, but I think this will also have solved the problem connecting to the database using codeigniter....