PHP5 with MySQL 4.1 on Apache 2 on Win98

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NevrGivUp

    PHP5 with MySQL 4.1 on Apache 2 on Win98

    Hello. I am in the process of learning php. I am particularly
    interested in its uses with MySQL. I have Apache 2 and PHP5 both
    installed and working fine. I pasted a MySQLi example for opening and
    connecting to a MySQL DB into "hello.php"

    <?php
    $mysqli = new mysqli("localho st", "my_user", "my_passwor d", "world");

    /* check connection */
    if (mysqli_connect _errno()) {
    printf("Connect failed: %s\n", mysqli_connect_ error());
    exit();
    }

    printf("Host information: %s\n", $mysqli->host_info);

    /* close connection */
    $mysqli->close();
    ?>


    For some reason when I get:

    Fatal error: Class 'mysqli' not found in D:\Apache
    group\Apache2\h tdocs\hello.php on line 7

    I installed PHP in "d:\php" and added it to my path in my autoexec.bat.
    in php.ini:
    ....
    extension_dir = "d:\php\ext "
    ....
    extension=php_m ysqli.dll

    I read all the posts at the bottom of the pages on PHP.net website where
    someone says "I had a problem and I got...yada...ya da and did everything
    each of those posts said you had to do and it still won't work.

    The only thing left is how PHP needs compiled with a "--with" statement
    or something like that but I'm using the windows binary so that
    shouldn't be a problem...

    Is there some other problem it could be besides a problem with finding a
    dll or ini?

    Thanks

    Bryce Byrd
  • Mike Willbanks

    #2
    Re: PHP5 with MySQL 4.1 on Apache 2 on Win98

    > Fatal error: Class 'mysqli' not found in D:\Apache[color=blue]
    > group\Apache2\h tdocs\hello.php on line 7[/color]

    Check for the mysql functions by function_exists also look for it in the
    phpinfo. You can make the page by using <?php phpinfo(); ?>

    That should help you figure out whats not happening.

    Mike

    Comment

    • Mladen Gogala

      #3
      Re: PHP5 with MySQL 4.1 on Apache 2 on Win98

      On Thu, 05 May 2005 02:48:08 +0000, NevrGivUp wrote:
      [color=blue]
      > Is there some other problem it could be besides a problem with finding a
      > dll or ini?[/color]

      Well, if you take a look in apache log, the file error.log will tell you
      exactly what the problem is.

      --
      Egoist: A person of low taste, more interested in themselves than in me.

      Comment

      Working...