Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th August 2006, 06:37
reddog reddog is offline
Junior Member
 
Join Date: May 2006
Location: Chicago, IL. USA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP problem or MySql problem , maybe both?

I've been trying setup apache, mysql, php, and phpmyadmin on a linux box here at home. I have apache up and running, that one is easy. MySql is also running and has a root user and password set. Php is working as far as i can tell, at least the phpinfo() script says so. phpMyAdmin is working fine as well, and as far as i can tell is connecting to the database. So i loaded up nuke7.5 for testing, installed the sql for 7.5. However when i go to http://mysite.com/index.php, i get the following errors:


Warning: main(db/mysql.php) [function.main]: failed to open stream: No such file or directory in /srv/www/htdocs/db/db.php on line 53

Warning: main() [function.include]: Failed opening 'db/mysql.php' for inclusion (include_path='/usr/share/php') in /srv/www/htdocs/db/db.php on line 53

Fatal error: Cannot instantiate non-existent class: sql_db in /srv/www/htdocs/db/db.php on line 86



Coincidentally, when i run the phpinfo(). Under the MySql section the following values read like this:


MySql Includes = "No Value"
MySql Libs = "No Value"
MySql_Modules_Type = "None"



I'm thinking i missed something in one of the config files, and I've gone over it many times. But the errors throw me off, because i don't know diddly about php. So i was hoping one of you gurus could interpret what the errors mean.Thanks in advance for any replies !!

Here are a few more specs:
Suse Linux 10.0
Apache2 - 2.0.54
MySql - 4.1.13
PHP4 - 4.4.0
phpMyAdmin - 2.7.0 -pl2

btw, here is a copy of db.php
Code:
<?php
/***************************************************************************
 *                                 db.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: db.php,v 1.10 2002/03/18 13:35:22 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *   This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
 *   by Tom Nitzschner (tom@toms-home.com)
 *   http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
 *
 *   As always, make a backup before messing with anything. All code
 *   release by me is considered sample code only. It may be fully
 *   functual, but you use it at your own risk, if you break it,
 *   you get to fix it too. No waranty is given or implied.
 *
 *   Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
 *   then on my site. All original header code and copyright messages will be maintained
 *   to give credit where credit is due. If you modify this, the only requirement is
 *   that you also maintain all original copyright messages. All my work is released
 *   under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

global $forum_admin;
if ($forum_admin == 1) {
    $the_include = "../../../db";
} elseif ($inside_mod == 1) {
    $the_include = "../../db";
} else {
    $the_include = "db";
}

switch($dbtype) {

	case 'MySQL':
		include("".$the_include."/mysql.php");
		break;

	case 'mysql4':
		include("".$the_include."/mysql4.php");
		break;

	case 'postgres':
		include("".$the_include."/postgres7.php");
		break;

	case 'mssql':
		include("".$the_include."/mssql.php");
		break;

	case 'oracle':
		include("".$the_include."/oracle.php");
		break;

	case 'msaccess':
		include("".$the_include."/msaccess.php");
		break;

	case 'mssql-odbc':
		include("".$the_include."/mssql-odbc.php");
		break;
	
	case 'db2':
		include("".$the_include."/db2.php");
		break;

}

$db = new sql_db($dbhost, $dbuname, $dbpass, $dbname, false);
if(!$db->db_connect_id) {
    die("<br><br><center><img src=images/logo.gif><br><br><b>There seems to be a problem with the MySQL server, sorry for the inconvenience.<br><br>We should be back shortly.</center></b>");
}

?>

Last edited by reddog; 11th August 2006 at 07:04.
Reply With Quote
Sponsored Links
  #2  
Old 11th August 2006, 12:24
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,146
Thanks: 4
Thanked 55 Times in 51 Posts
Default

does nuke 7.5 make use of PEAR? This sounds very much like a PEAR problem
Quote:
'db/mysql.php' for inclusion (include_path='/usr/share/php')
Reply With Quote
  #3  
Old 12th August 2006, 17:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

You could modify that script so that it shows you the value of $the_include:
Code:
global $forum_admin;
if ($forum_admin == 1) {
    $the_include = "../../../db";
} elseif ($inside_mod == 1) {
    $the_include = "../../db";
} else {
    $the_include = "db";
}
echo $the_include;
Then check your installation if all files are where that scripts expects them to be.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 13th August 2006, 19:46
reddog reddog is offline
Junior Member
 
Join Date: May 2006
Location: Chicago, IL. USA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello Falko,

I added your script to my phpinfo(), however i get the same results.

Quote:
Then check your installation if all files are where that scripts expects them to be.
do you mean to check the install of php-nuke? if so, the install looks good, everything is where it should be. Also php-nuke loads it's own .htaccess files, do i need to change my apache config to accomodate for those .htaccess?

this is what httpd.conf contains

Quote:
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
thanks for your help !!
Reply With Quote
  #5  
Old 14th August 2006, 18:02
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Quote:
Originally Posted by reddog
do you mean to check the install of php-nuke?
With the echo statment, you should be able to find out where phpNuke expects the file. Then either copy the files to the location where phpNuke expects them, or change the value of $the_include.

Quote:
Originally Posted by reddog
Also php-nuke loads it's own .htaccess files, do i need to change my apache config to accomodate for those .htaccess?
Maybe.

Quote:
Originally Posted by reddog
this is what httpd.conf contains
That's the wrong section. There must be other <Directory> stanzas, find the one for the directory or one of the parent-directories where phpNuke is installed.

What's in the .htaccess file?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 15th August 2006, 17:14
reddog reddog is offline
Junior Member
 
Join Date: May 2006
Location: Chicago, IL. USA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello Falko,

well, i got a lead on what may be the problem. originally i installed apache, php, and mysql through yast, in suse10. I have been told that i need to compile apache with the options: "--with-mysql" as well as "--with-mysqli"

so im off to give that try.

thank you for your time and help with my problems !!
Reply With Quote
  #7  
Old 16th August 2006, 07:34
reddog reddog is offline
Junior Member
 
Join Date: May 2006
Location: Chicago, IL. USA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

just a quick update, and more for anybody else that may have had the same problems i did. I did a clean install of suse10 (the old windows in me) following a portion of perfect setup for suse10, mostly for the os itself and proftpd.

as for apache2, mysql, php5, and phpmyadmin. All were compiled from source, and after a bit of configuration, it all worked.......woot !!

dont mean to step on anyones toes, but here is the tut i followed:

http://laffers.net/howtos/howto-install-mysql
Reply With Quote
  #8  
Old 16th August 2006, 09:21
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Quote:
Originally Posted by reddog
hello Falko,

well, i got a lead on what may be the problem. originally i installed apache, php, and mysql through yast, in suse10. I have been told that i need to compile apache with the options: "--with-mysql" as well as "--with-mysqli"

so im off to give that try.

thank you for your time and help with my problems !!
as far as i can remember ./configure --help tells you to either use --with-mysql or --with-mysqli, but not both...
Reply With Quote
Reply

Bookmarks

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
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
how to make php to work with mysql (php installed with apt-get, (no mysql support) grafik Installation/Configuration 3 15th May 2006 23:18
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 13th March 2006 23:58
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04
Problem installing ISPConfig, then with MySQL... ctroyp Installation/Configuration 7 26th September 2005 16:37


All times are GMT +2. The time now is 11:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.