Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: VTM questions

  1. #1
    Join Date
    Nov 2004
    Posts
    8

    Unhappy VTM questions

    I just got the php/mysql VTM. I am trying to get the connection to the db, but I don't get any information on the page when I load the temp_config.php page. Here's what I've got so far:

    Windows 2000
    Apache 2.0.52
    PHP 4.3.9
    MySQL 4.1

    db_config.php:

    <?php
    $db_host = "localhost";
    $db_user = "php";
    $db_password = "f00";
    $db_name = "shubdb";
    ?>

    temp_config.php:

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."config/db_config.php");
    $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
    echo "connection made";
    ?>

    Added the following to httpd.conf:

    LoadModule php4_module "c:/php/sapi/php4apache2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"

    Does anyone see any problems with this, or is there more information that you need to be able to tell? PHP pages not connecting to mySQL work, but the mySQL connection does not display any information when loading the page.

    Thanks!

  2. #2
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    you need a "/" just before config in the line: require($_SERVER["DOCUMENT_ROOT"]."config/db_config.php"); it should look like this: require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");

    Also make sure that your include path is set in your php.ini to include that folder for your config settings.
    Last edited by mcarman; 11-10-2004 at 02:59 PM.

  3. #3
    Join Date
    Nov 2004
    Posts
    8
    Thanks, but I still get an error connecting. I know that the username and password match what's in mysql. All of the other PHP pages run fine. Is there any NT security that I have to deal with?

  4. #4
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    What error are you getting? That would help.

  5. #5
    Join Date
    Nov 2004
    Posts
    8
    There is no specific error displayed, and I did not silence the error through php. I just the error connecting message that is set on:

    $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");

    Is there someplace within apache, php, or mysql that hides error messages by default?

  6. #6
    Join Date
    Jul 2003
    Location
    UK
    Posts
    245
    Originally posted by shub
    There is no specific error displayed, and I did not silence the error through php. I just the error connecting message that is set on:

    $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");

    Is there someplace within apache, php, or mysql that hides error messages by default?
    change die("error connecting") to die(mysql_error()) and see what error message it give you.

  7. #7
    Join Date
    Nov 2004
    Posts
    8
    Here's the error message:

    Client does not support authentication protocol requested by server; consider upgrading MySQL client

    I thought mySQL 4.1 supported authentication protocol though

  8. #8
    Join Date
    Jul 2003
    Location
    UK
    Posts
    245
    in this case, i think the client mean your php code not the server.

    try change

    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");

    to

    require("config/db_config.php");
    Last edited by NeoMT; 11-10-2004 at 05:39 PM.

  9. #9
    Join Date
    Jul 2004
    Location
    N29° 22.725' X W95° 6.452'
    Posts
    343
    I dont believe that is is set off by default but check your php.ini file for this line: display_errors = On, make sure it says "On".

    If it is off then set it as ON and try your script again and post back any errors. If it is "ON" then I dlnt know what to tell you because I made two pages with the information you gave above and it works fine for me. Other than omitting that "/" I dont see anything else wrong with it.

    Let me know what you find.

  10. #10
    Join Date
    Nov 2004
    Posts
    8
    Originally posted by NeoMT
    in this case, i think the client mean your php code not the server.

    try change

    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");

    to

    require("config/db_config.php");

    I made the change and get the same error.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •