[solved][PHP/MYSQL/Apache] My sites works on Windows

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/Apache] My sites works on Windows

Post by ayu »

I transfered all my work to my Linux lappy today, where i have prepared mysql php and apache, everything went well with importing the tables and such....but something is wrong with using mysql with PHP.....my pages doesn't show.

When i make a document with only

<?php
echo 'hello';
?>

it works....but if i then add a connection to mysql

<?php
include('config.php');
$connect = @mysql_connect("$host","$user","$pass")
or die('Could not connect to DB');
echo 'hello';
?>

It doesn't work, it doesn't even show the die message, and not the "hello" message either.

I have checked username and pass and i can connect to the DB using my sql client.

Does anyone have a clue of what i am doing wrong?

Or should i provide more info?
Last edited by ayu on 30 Sep 2007, 09:16, 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
18
Location: In your eye floaters.
Contact:

Post by bad_brain »

what says phpinfo about mysql?

Code: Select all

<?php
phpinfo();
?>
:-k

also check the mysql logs in /var/log

:wink:

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

Post by ayu »

phpinfo(); gives me LOADS of info, nothing about mysql though.

and both mysql.err and mysql.log were empty =/
"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
18
Location: In your eye floaters.
Contact:

Post by bad_brain »

shell access available for me? ^^
it's hard to do a diagnosis, because there are loads of possibilities... :?

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

Post by ayu »

gogo IRC ^^
"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 »

Kk so after a lot of idling from me.....b_b helped me to solve it.....

apparently it worked with installing mysql-client.

Why that works....well....only the Gods know!


Anyway it works now :D thanks b_b!
"The best place to hide a tree, is in a forest"

Post Reply