![]() |
troubleshooting my pear installation
I'm having some trouble getting pear working on my server (Ubuntu 7.04, Apache 2.2.3, MySQL 5.0, php 5.2.1). I'm certain my LAMP setup is working fine as I can use php to connect to my db and run queries. I have thus far, however, failed to get the db connection to work via pear.
I installed pear from the repository and used it to install the database module. :
$pear listThe code I used to test the connection is below. I added several print statements to try to find where it was failing, and the output is nothing but the first line ("Attempting to connect to MySQL database...") Any help would be appreciated. [PHP]<?php // Required imports require_once('/usr/share/php/DB.php'); echo ("Attempting to connect to MySQL database...<br />"); // Initiate the MySQL connection $connection = DB::connect("mysql://testuser:testpass@localhost/test"); echo ("Connected...<br />"); // Test the connection if (DB::isError($connection)){die ("Couldn't connect!<br />".DB::errorMessage($connection));} echo ("DB::isError done...<br />"); ?>[/PHP] |
Hi,
Have you attempted to change "@localhost" to something like "@127.0.0.1" or even "@127.0.0.1:3306"? I run into a somewhat similar issue like that with XAMPP. I have to be very explicit with the connection or it will fail Cheers, tom |
| All times are GMT -5. The time now is 3:11 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC