SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question Problems with PHP5.0.3, Apache2.0.52 and MySQL4.1.7

    Hi guys...

    I am having problems getting PHP to talk to MySQL. I've posted a message into the MySQL forum too but the fixes mentioned there don't seem to work for me.

    Basically, when I try to get PHP to query MySQL I get a message saying "Fatal error: Call to undefined function mysql_connect() in E:\Program Files\Apache\Apache2\htdocs\action\connect.php on line 7". I have provided some further information on the setup of the system below:

    > Windows XP Pro SP2
    > Apache 2.0.52-win32-x86-no_ssl (E:\Program Files\Apache\Apache2)
    > MySQL 4.1.7 (E:\Program Files\MySQL\MySQL Server 4.1)
    > PHP 5.0.3-dev (E:\Program Files\php-5.0-Win32)

    I have read that this combination requires libMySQLi.dll and php_mysqli.dll, as opposed to the previous libMySQL.dll and php_mysql.dll files. The php_mysqli.dll file is not a problem as it is in the .\ext directory in the main PHP directory. I've uncommented
    extension=php_mysqli.dll in the PHP.ini which is saved in the PHP folder as well as in my Windows directory (C:\Windows.0) and even tried saving it in the two system folders (C:\Windows.0\system and C:\Windows.0\system32)

    1) I cannot find libMySQLi.dll anywhere on the PC, although I can find libMySQL.dll, which is in the same four directories as the PHP.ini file
    2) When I start Apache, I get two windows, both of which say "PHP Startup: Unable to load dynamic library './ext/php_mysqli.dll' - The specified module could not be found."

    I get the exact same message if I try to use the standard php_mysql.dll as well. Both files are present in the PHP EXT folder. I've uploaded my PHP.INI and APACHE.CONF files to another site if you want to have a look at them. You'll find them here. If you don't mind taking a look and getting back to me I'd be VERY appreciative!

    Cheers guys!
    Last edited by Antnee; Nov 21, 2004 at 08:49.

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    Boston
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    PHP Version 5* is not mapped to ./ext/ by default! It still is referenced as /extensions/ following the PHP 4 folder setup! Because the dll is sub linking dll it can not be stored like you have it, because the map does not point to that directory!

    Blame windows for the crazy way it sets paths for this issue! If you would like me to create a PHP install that you can download based on PHP 5.0.3 I will. All you will have to do is download the zip and replace your PHP folder with the one in the zip or you can just use your files and setup the PHP directory the exactly how my example will be! Then restart Apache and you will be fine!

    I would write out the structure here, but with over 100 files it would take to much time to explain where each file should be placed!


    J!

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    UK
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Once you do get it working you may get problems with MySQL 4.1 and phpmyadmin also. Like most other open source bugs are prevalent. Get the latest patch for phpmyadmin.

  4. #4
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I have NO idea what phpmyadmin is to be honest! All I use apart from the servers listed is Dreamweaver and MySQL-Front

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Antnee
    I have NO idea what phpmyadmin is to be honest!
    phpMyAdmin is a web based MySQL administration tool.

    Quote Originally Posted by Antnee
    I've posted a message into the MySQL forum too but the fixes mentioned there don't seem to work for me.
    I've removed the post from that forum, because cross posting your problem is confusing.

  6. #6
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Helge
    phpMyAdmin is a web based MySQL administration tool.

    I've removed the post from that forum, because cross posting your problem is confusing.
    I figured phpMyAdmin could be something like that, I just use MySQL-Front instead. As for removing that post, I figured I may have been more likely to find an answer there to be honest, but I see your point!

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    UK
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you absolutely need php5 try out the apachefriends xammp installer package. Its bundled with 4+5 and MySQL and phpMyAdmin ready to go. GD and Ming are in but mm_cache is not in the latest version. Hope this helps.

  8. #8
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't absolutely need PHP5, I had to upgrade because of MySQL4.1! I'm going back to an older PHP, MySQL and Apache in a few minutes, I'm fed up of having to spend so much time getting these ones talking to each other!

  9. #9
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just use mysql 4.0 and everuthing will work!
    i had problems to install 4.1 too!

  10. #10
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK, I installed WAMP5 and everything seemed hunky-dory, until I tried to get something out of the damn database. I get an error that says:
    Parse error: syntax error, unexpected T_VARIABLE in c:\wamp\www\system3cs\action\connect.php on line 8
    Here's what my connection script looks like:

    PHP Code:
    <?php
        $host 
    "localhost";
        
    $user "XXXX";
        
    $pass "XXXX";
        
    $dbname "XXXX";
        
    $prefix "XXXX"
        
        
    $connection mysql_connect($host,$user,$pass) or die (mysql_errno() . ": " mysql_error() . "<br>");
        
    mysql_select_db($dbname) or die( "Unable to select database");
     
    ?>
    Please someone tell me what's going on!

  11. #11
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    England
    Posts
    698
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dear dear, I just realised I forgot a ; on the end of the $PREFIX line, what an amateur!


Bookmarks

Posting Permissions

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