Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 27th, 2007, 10:52 PM   #1
somehollis
Programmer
 
somehollis's Avatar
 
Join Date: May 2006
Location: Memphis, TN
Posts: 31
Rep Power: 0 somehollis is on a distinguished road
Send a message via AIM to somehollis
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 list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.2   stable
Console_Getopt   1.2.3   stable
DB               1.7.12  stable
PEAR             1.6.1   stable
Structures_Graph 1.0.2   stable

The 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]
somehollis is offline   Reply With Quote
Old Sep 4th, 2007, 2:53 PM   #2
tgiles
Newbie
 
Join Date: Oct 2006
Posts: 2
Rep Power: 0 tgiles is on a distinguished road
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
tgiles is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware installation guide for Linux beginners coldDeath Coder's Corner Lounge 104 Jul 29th, 2007 5:40 AM
Use PEAR DB or MySQL ssrun PHP 6 Apr 27th, 2007 10:38 AM
installation logger/uninstall verifier melbolt Project Ideas 5 Aug 1st, 2006 9:32 PM
Trouble with Visual C++ 2005 Express Edition installation swedish_dude Other Programming Languages 9 Feb 18th, 2006 8:31 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:02 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC