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');A bit late now, but I think this will also have solved the problem connecting to the database using codeigniter....
if($conn) {
echo 'Finally connected!!!';
} else {
die('Still cannot connect' . mysql_error());
}
?>
No comments:
Post a Comment