There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
apache can't use php to talk to mysql...help please


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
mushka's Avatar
Member with 50 posts.
 
Join Date: Sep 2004
Experience: much to learn
09-Nov-2004, 02:20 PM #1
apache can't talk to mysql...help please
Hi there, more problems for me, but huge thanks to those that helped last time.

This time, when I try to load my webpage (recently had one built using php) I'm getting this message: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/global.php on line 47 (feel free to look 'www.mushka.com' -please be nice, my security may not be all it should right now but friendly advice welcomed).
obviously the global.php is specific to my site but the problem is that apache can't say hello to mysql. The reason for this it seems is that I don't have the relevant php-mysql mod installed (tried rpm -qa | grep php and no mention of php-mysql).
Only problem is that everytime I try to install one I get the same "not a valid rpm file" message displayed.

I'm on Fc1, apache 2.0.50, mysql 4.1.7

have I made some fundamental blunder or is it a reinstallation of a more complete rpm of apache?

or neither?

throw me a bone.

chz ben

ps if you can point me to an rpm that you know is working that would be a great help

Last edited by mushka : 09-Nov-2004 02:36 PM.
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
09-Nov-2004, 04:07 PM #2
do you have mod_php installed? If not you need that installed so that apache can talk to php.

That should fix at least part of the problem.
mushka's Avatar
Member with 50 posts.
 
Join Date: Sep 2004
Experience: much to learn
09-Nov-2004, 05:05 PM #3
got that now, next prob=

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /var/www/html/global.php on line 47
Invalid Query: SELECT * FROM items WHERE item_page=1 AND item_publish=1 ORDER BY item_date desc,item_id desc


thoughts?

chz

could there be anything changed in the syntax of the php file to allow the query?

here's the **edited** version of the global.php file

<?php
$global=array(
'dir'=>array(
'tpl'=>'/***/***/***s*',
'resource'=>'/***/***/***/***',
'banners'=>'/***/***/***/***/***',
),
'url'=>array(
'resource'=>'/***',
'banners'=>'/****/***',
),
'types'=>array(
'pdf'=>'pdf',
'doc'=>'doc',
'jpg'=>'img',
'JPG'=>'img',
'gif'=>'img',
'jpe'=>'img',
'jpeg'=>'img',
'png'=>'img',
'mov'=>'mov',
'mp3'=>'mp3',
'wma'=>'wma'
),
'admin'=>array(
'username'=>'***',
'password'=>'***',
'email'=>'***@***.com'
),
'meta'=>array(
'keywords'=>'***, ***, ***, ***, ***,***,***, ***, ***',
'description'=>'**********'
),
'default_page_id'=>array(
'index'=>1,
'contact'=>2
)
);

$db_connect=0;

#error_reporting(E_ERROR);

function _db_connect() {
global $db_connect;
if (!$db_connect) {
mysql_connect('l**','**','**');
mysql_select_db('**');
$db_connect=1;
}
return;
}

function db_query($sql){
_db_connect();
$rows=array();
$result=mysql_query($sql) or die('Invalid Query: '.$sql);
return $result;
}

function db_insert($sql){
_db_connect();
$rows=array();
$result=mysql_query($sql) or die('Invalid Query: '.$sql);
return mysql_insert_id();
}

function db_select_array($sql){
_db_connect();
$rows=array();
$result=mysql_query($sql) or die('Invalid Query: '.$sql);
while ($row=mysql_fetch_array($result)){
array_push($rows,$row);

Last edited by mushka : 09-Nov-2004 05:14 PM.
mushka's Avatar
Member with 50 posts.
 
Join Date: Sep 2004
Experience: much to learn
10-Nov-2004, 08:23 AM #4
FYI all those who have a similar problem here was the fix:http://dev.mysql.com/doc/mysql/en/Password_hashing.html

chz
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
10-Nov-2004, 06:13 PM #5
gomen for not getting back to yo uon this one. Glad you found the answer (school & works been kicking my butt and i've been zonking out way too early) and posted it in here.
Reply


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

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
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:54 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.