Page 1 of 2 12 LastLast
Results 1 to 16 of 19

Thread: MySQL extension for PHP 5.2.3 not working

  1. #1
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts

    MySQL extension for PHP 5.2.3 not working

    Hey everyone,

    Today I felt like getting rid of the Apache2Triad server bundle (which includes many servers I never use) and decided to install fresh installations of Apache 2.2, MySQL 5.0.41 and PHP 5.2.3 (all latest versions, according to their sites). But there is one thing not working properly: MySQL in PHP.

    Apache install information
    I installed the Apache 2.2 server to C:\Program Files\Apache 2.2. I didn't install the documentation, because if I use it, the online documentation is usually more up-to-date. The root directory you see when going to http://localhost (http://84.107.204.56 for you guys ;p) is C:\Program Files\Apache 2.2\htdocs.

    MySQL install information
    I installed the MySQL 5.0.41 server to C:\Program Files\MySQL Server 5.0. I installed all the 'Client Programs' (Command Line Shell, Command Line Utilities and Server Instance Config) and the 'Instance Manager' and left out the Documentation and Developer Components.

    PHP install information
    I installed PHP 5.2.3 to C:\Program Files\PHP. In the setup options, I selected both 'CLI Executable' and 'Script Executable', the Web Server Setup for Apache 2.2.x and the extentions GD2 (which is working just fine) and MySQL. My php.ini file is located in the PHP root directory (see above). Extension_dir is set to /ext in the PHP root directory. The php_mysql.dll file is in /ext in the PHP root directory and is uncommented (un-semi-colon-ed ;p lol) in php.ini, just like the php_gd2.dll file. There is a file libmysql.dll in the PHP root directory. Before you ask so, I did restart the Apache server. You can find all information provided by phpinfo() in http://84.107.204.56/phpinfo.php (only when my computer is online, of course, which it will be in around 10 hours from now).

    I'm quite sure it's the MySQL extension which is not working, because:
    -It is nowhere mentioned in phpinfo() (but GD2 is...)
    -I'm getting the following error in phpMyAdmin: "Cannot load mysql extension. Please check your PHP configuration."
    -I'm getting the following error in my phpBB2 testing board (which will be kinda empty as I forgot to export the database before uninstalling Apache2Triad ;p): "Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache 2.2\htdocs\phpBB2\db\mysql4.php on line 48."

    I hope there's anyone around who can help me find the problem, as I can't find it myself after trying all kinds things for about an hour and a half.

    Thanks in advance for any replies,
    Jerry
    Last edited by Jerrythafast; 12-06-2007 at 10:59 PM.

  2. #2
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    Its been a while since I did a MySQL install but I recall that newer versions of PHP do not load it by default. If it doesn't show up when you call phpinfo(); make sure you have the ini file set to load the .dll (or whatever it is on Windoze, its been even longer for me doing a Windows install).

  3. #3
    Fried Chip Extremist alsenior's Avatar
    Join Date
    Nov 2005
    Location
    Stafford
    Posts
    2,949
    Thanks
    103
    Thanked
    191 times in 145 posts
    • alsenior's system
      • Motherboard:
      • DFI Lanparty Jr x58-T3H6
      • CPU:
      • Core i7 920
      • Memory:
      • 6 x 2GB ocz Gold
      • Storage:
      • 1 TB Samsung F3
      • Graphics card(s):
      • 1gb 4890 vapor-x xfire
      • PSU:
      • xfx 850W
      • Case:
      • Lian-li Pc7
      • Operating System:
      • Windows 7 X64
      • Monitor(s):
      • Dell 2208WFP
      • Internet:
      • 30mb Virgin media
    have you installed myodbc connector and set it up? it is a seperate install package
    Quote Originally Posted by Jay View Post
    What kind of emergency would need Windows 95? I think you are already in a bad state of emergency when your backup plan is Windows 95.
    Beginners guide to raid Beginners guide to raid post edition Hexus.Social - FAQ

  4. #4
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    The MyODBC is not needed. He wants the MySQL plugin directly. Reading more carefully I could suggest verifying the MySQL thinggy is right for the version you have. Can you find any logs for apache/php startup that complain about anything?

  5. #5
    Member
    Join Date
    Jul 2006
    Posts
    83
    Thanks
    0
    Thanked
    10 times in 9 posts
    Have you started the MySQL service? You might want to run the MySQL Configuration Wizard which is located in your MySQL installation folder.

  6. #6
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    Its got be more than that. Now that the phpinfo(); stuff is up its clear that the dll isn't loading. Can you copy your .ini file, rename it .txt and give us a link, thanks.

  7. #7
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by awm View Post
    Its been a while since I did a MySQL install but I recall that newer versions of PHP do not load it by default. If it doesn't show up when you call phpinfo(); make sure you have the ini file set to load the .dll (or whatever it is on Windoze, its been even longer for me doing a Windows install).
    1) You are right it's not loaded by default (in fact, it's not even installed by default).
    2) As said, the php.ini file contains a referance to the MySQL dll file, and it's not commented out.
    Quote Originally Posted by alsenior View Post
    have you installed myodbc connector and set it up? it is a seperate install package
    ==>
    Quote Originally Posted by awm View Post
    The MyODBC is not needed. He wants the MySQL plugin directly. Reading more carefully I could suggest verifying the MySQL thinggy is right for the version you have. Can you find any logs for apache/php startup that complain about anything?
    I just tried to find a log complaining about something, and I got this from the Apache error log:
    Code:
    [Wed Jun 13 09:23:43 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 configured -- resuming normal operations
    [Wed Jun 13 09:23:43 2007] [notice] Server built: Jan  9 2007 23:17:20
    [Wed Jun 13 09:23:43 2007] [notice] Parent: Created child process 920
    PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_mysql.dll' - Kan opgegeven procedure niet vinden.\r\n in Unknown on line 0
    [Wed Jun 13 09:23:43 2007] [notice] Child 920: Child process is running
    [Wed Jun 13 09:23:43 2007] [notice] Child 920: Acquired the start mutex.
    [Wed Jun 13 09:23:43 2007] [notice] Child 920: Starting 250 worker threads.
    [Wed Jun 13 09:23:43 2007] [notice] Child 920: Starting thread to listen on port 80.
    "Kan opgegeven procedure niet vinden" is Dutch for "Can't find selected procedure".
    Quote Originally Posted by Budding View Post
    Have you started the MySQL service? You might want to run the MySQL Configuration Wizard which is located in your MySQL installation folder.
    mysqld-nt.exe is running, I think that's the service. In services.msc MySQL 5 shows up as 'Gestart' (Started). I have run the Configruation Wizard directly after installation.
    Quote Originally Posted by awm View Post
    Its got be more than that. Now that the phpinfo(); stuff is up its clear that the dll isn't loading. Can you copy your .ini file, rename it .txt and give us a link, thanks.
    http://84.107.204.56/php.txt

  8. #8
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    Switch to the mysqli extension (next line after mysql) its the improved version. Also make sure the extension matches with you install version. If the mysql install came with a php extension use that. Best of luck!

  9. #9
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Installed MySQLi extension through the PHP installer and checked if php.ini was updated correctly and the file was present. Restarted Apache. The php.txt file has also been updated. Things stil don't work.

    Error log now says:
    Code:
    [Wed Jun 13 15:49:36 2007] [notice] Parent: Received restart signal -- Restarting the server.
    [Wed Jun 13 15:49:36 2007] [notice] Child 920: Exit event signaled. Child process is ending.
    [Wed Jun 13 15:49:37 2007] [notice] Child 920: Released the start mutex
    [Wed Jun 13 15:49:40 2007] [notice] Child 920: Waiting for 250 worker threads to exit.
    [Wed Jun 13 15:49:40 2007] [notice] Child 920: All worker threads have exited.
    [Wed Jun 13 15:49:40 2007] [notice] Child 920: Child process is exiting
    [Wed Jun 13 15:49:40 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 configured -- resuming normal operations
    [Wed Jun 13 15:49:40 2007] [notice] Server built: Jan  9 2007 23:17:20
    [Wed Jun 13 15:49:41 2007] [notice] Parent: Created child process 2704
    PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_mysql.dll' - Kan opgegeven procedure niet vinden.\r\n in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_mysqli.dll' - Kan opgegeven procedure niet vinden.\r\n in Unknown on line 0
    [Wed Jun 13 15:49:41 2007] [notice] Child 2704: Child process is running
    [Wed Jun 13 15:49:41 2007] [notice] Child 2704: Acquired the start mutex.
    [Wed Jun 13 15:49:41 2007] [notice] Child 2704: Starting 250 worker threads.
    [Wed Jun 13 15:49:41 2007] [notice] Child 2704: Starting thread to listen on port 80.
    There is only one dll file in the MySQL directory, it's /bin/libmySQL.dll. It's entirely different from the one in the PHP directory. I tried to replace the one that came with PHP with the one that came with MySQL (restarted Apache) but this also didn't work.

  10. #10
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Lol now it's working. Now that I know what PHP writes to the error log, I tried searching that instead of 'Call to undefined function'. I ended on this page:
    http://www.cementhorizon.com/wiki/in...d_not_be_found.

    It says that, though the PHP directory is in the Paths it's still required to put the libmyql.dll file in the system32 direcory. If there is any solution to this, so that I can leave it in the PHP directory, I'd like to know as I prefer to have things in their 'normal' folders ;p

  11. #11
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Okay, now I ran into another problem. When I try to set up phpMyAdmin it complains about the files not being writeable. As I'm running Windows, I can't CHMOD the folder. Everyone everywhere is saying just the same three words: rightclick properties security. Even the phpMyAdmin documentation says the same three words. However, there is no Security tab/button/link/whatever anywhere in the properties window The only option Windows gives me, is to share it with other computers inside the LAN.

    WTH?

  12. #12
    Member
    Join Date
    Jul 2006
    Posts
    83
    Thanks
    0
    Thanked
    10 times in 9 posts
    Do you actually have the php_mysql.dll and php_mysqli.dll in your PHP/ext folder?? Seems to me you are missing those files.
    If you are, then you need to download the bigger PHP installation binary file as opposed to the windows executable, and copy the correct libraries into your /ext/ folder. All the extension libraries will be located in the binary.

    Edit: above is reply to your previous previous post

    Which files is it saying that is not writable? Perhaps it's the database access rights in MySQL that need to be modified instead of the actual files in Windows. If you want to change file permission in Windows, it's right click>Properties>Attributes
    Last edited by Budding; 13-06-2007 at 03:48 PM.

  13. #13
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by Budding View Post
    Which files is it saying that is not writable? Perhaps it's the database access rights in MySQL that need to be modified instead of the actual files in Windows. If you want to change file permission in Windows, it's right click>Properties>Attributes
    phpMyAdmin says
    "Please create web server writable folder config in phpMyAdmin toplevel directory as described in documentation. Otherwise you will be only able to download or display it."
    When clicking on the word 'documentation' I get information on how to CHMOD things on Linux/Unix and a link to FAQ #1.26 which contains the three words.

    The attribute Write Only is not selected on any file.

  14. #14
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    Are you running Windows Home edition. Those sometimes hide all the permissions stuff.

  15. #15
    Registered+
    Join Date
    Feb 2007
    Posts
    48
    Thanks
    0
    Thanked
    0 times in 0 posts
    Yeh, I am. Is there any way to unhide it?

  16. #16
    awm
    awm is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    US
    Posts
    920
    Thanks
    4
    Thanked
    7 times in 7 posts
    I'm not sure. I just have a Mac now. I just remember that was a problem. I'd suggest Google.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Making PHP and MySQL Talk?
    By Dav0s in forum Software
    Replies: 4
    Last Post: 18-09-2005, 10:53 PM

Posting Permissions

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