HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   PHP problem or MySql problem , maybe both? (http://www.howtoforge.com/forums/showthread.php?t=6135)

reddog 11th August 2006 07:37

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>");
}

?>


sjau 11th August 2006 13:24

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')

falko 12th August 2006 18:33

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.

reddog 13th August 2006 20:46

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 !!

falko 14th August 2006 19:02

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?

reddog 15th August 2006 18:14

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 !!

reddog 16th August 2006 08:34

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

Ben 16th August 2006 10:21

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...


All times are GMT +2. The time now is 04:34.

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