PDA

Click to See Complete Forum and Search --> : PHP / MySQL troubles (after manual install)


StrangerInBeijing
Dec 4th, 2009, 08:50 AM
This kind of relates to a previous post I posted here (http://www.vbforums.com/showthread.php?t=594208).

At first I thought my phpmyadmin installation is at fault, for I get the following error when I open it (after I installed Apache, MySQL, PHP, PEAR, phpmyadmin manually)
The connection was reset
The connection to the server was reset while the page was loading.

I gave up and stared using MySQL Administrator. (Which is great, thanks for the tip Kows)

However, just now I got back to this site I am working on, and I realize this problem occur whenever I hit the database (try to connect, I'm working on a simple sample to replicate the problem).

Anyone had a similar problem? I downloaded and installed the latest versions of A,M,P,P,pma, and verified they work after each install.
The thing I'm really new to is PEAR, so suspect I might have messed up something there.

Will probably be told to check my php.ini. So just for the heck of it I enabled all extensions. Uurgh.should have backed it up first (slapping myself).
I'm attaching that. (it' looks a bit more complicated than I'm used too).

kows
Dec 4th, 2009, 03:39 PM
This is very similar to a problem I have had previously, and I don't remember what I did. however, I have never used PEAR and I'm almost certain it's not even related to PHP. I think I may have played with MySQL's settings, or possibly even completely reinstalled MySQL. either way, it was a problem with the way I installed MySQL. try reinstalling it, if you'd like.

StrangerInBeijing
Dec 5th, 2009, 08:38 AM
Wish I could have said "Thanks for the tip, that worked out great". :sick:

Uninstalled (can be a problem if done wrong, but I got that), re-installed, and re-configured several times with different settings...No luck obviously.

Could it be due to the fact I'm using Win7? Naah, Xampp was working just fine before.

A simple piece of code like this cause everything to go down the drain (decided to work with sth really simple to nut this out):
$dbh = mysql_connect('localhost', 'root', 'password') or die("Unable to connect to MySQL");

With that in a page, all I get is "Problem loading page"..not even a mysql error or sth.

kows
Dec 5th, 2009, 12:46 PM
yeah, as far as I recall, it's a problem with the MySQL or Apache services (I'm leaning toward MySQL being the real problem here), or something. I seriously can't remember what it was. you could try making sure both services are running correctly -- but I don't know how to recreate the problem and can't remember how to fix it. the services log may have some errors in it that could help give you something concrete to google, though.

but, no, it's not Windows 7. I have a working install of Apache, MySQL and PHP on my Windows 7 machine, and I didn't run into this!

you might even want to try reinstalling Apache, but I really think it's MySQL. for all I know, the package you had installed before might have left some files lying around that caused some problems. I'm not so sure about that though.. maybe you could try another install of the package-deal just to see if it works!

StrangerInBeijing
Dec 6th, 2009, 04:44 AM
Here's the weirdest thing...
Basically as I said before, to "re-produce" my problem, in the simplest way, my index.php in my www folder look like this:
<html>
<body>
<?php
$dbh = mysql_connect('localhost', 'root', 'Pass@word1') or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
mysql_close($dbh);
?>
</body>
</html>
This "break" the page completely (without the db code, and just having phpinfo() works perfectly fine.
Now, I go and all I do is add "phpinfo();" before the db code....php info get displayed and at the bottom ""Connected to MySQL".

Does this proof anything? Don't even ask how I got to add phpinfo() there....bored/frustrated out of my skull I guess.
So this work fine! (No, really! Nothing else change!)
<html>
<body>
<?php
phpinfo();
$dbh = mysql_connect('localhost', 'root', 'Pass@word1') or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
mysql_close($dbh);
?>
</body>
</html>

StrangerInBeijing
Dec 6th, 2009, 05:08 AM
PS: Posted the problem on my cr@ppy website (http://www.lenocin.com/) with some more details, as I want to ask on other forums also. (Not that I know any as good as VBF)

kows
Dec 6th, 2009, 01:21 PM
I really don't know. as far as reproduction goes, I meant recreating the problem with your install so that I could try to fix it, really. ;(

good luck, though