[Solved][PHP/mySQL/Apache2] Doesn't seem to connect

Don´t be shy, Linux is fun! =)
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

[Solved][PHP/mySQL/Apache2] Doesn't seem to connect

Post by ayu »

Ok so i just reinstalled my laptop, and just got everything setup again as i want. I encountered a problem now though with either Apache2, mySQL or PHP, i suspect PHP or mySQL the most though.

Because when i tried to login to my site, i could reach the login page, but if i try to login the page goes blank.

So i did a test code to try and find the problem.

This is the test code....

Code: Select all

<?php
echo $_SERVER[HTTP_USER_AGENT];
$connect = @mysql_connect('localhost','root','lol')
or die('Could not connect to database');
$database = mysql_connect_db('anime')
or die('Could not find database');
echo "connected";
?>
This is the output....

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20071008 Ubuntu/7.10 (gutsy) Firefox/2.0.0.6

As you can see it only prints the client info, nothing about the mysql connection. It's like it just ignores it.

Any suggestion would be awesome, I'm watching anime and i have to update the database through mySQL navigator : <

Thanks in advance ^^
Last edited by ayu on 22 Oct 2007, 15:33, edited 1 time in total.
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

what is the output for:

Code: Select all

dpkg -l mysql*
?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Code: Select all

root@clare:/home/cats# dpkg -l mysql*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  mysql-client   <none>         (no description available)
ii  mysql-client-5 5.0.45-1ubuntu MySQL database client binaries
ii  mysql-common   5.0.45-1ubuntu MySQL database common files
un  mysql-doc-5.0  <none>         (no description available)
ii  mysql-navigato 1.4.2-9        GUI client program for MySQL database server
un  mysql-server   <none>         (no description available)
ii  mysql-server-5 5.0.45-1ubuntu MySQL database server binaries
root@clare:/home/cats# 
Note: I can connect with Mysql Navigator and manage my DB from there. Problem is that I need the server to work by tomorrow, since I have a project in school.
"The best place to hide a tree, is in a forest"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Problem solved.

I forgot to install php5-mysql ^^
"The best place to hide a tree, is in a forest"

Post Reply