PHP5.05, Mysql4.1, Apache on Windows XP - cant get php to talk to mysql

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

    #1

    PHP5.05, Mysql4.1, Apache on Windows XP - cant get php to talk to mysql

    Hi

    I have read all (ok most) of the posts relating to "Call to undefined
    function mysql_connect() ", read the manual on PHP.net and done
    eveything thats ive been asked to do but cant get PHP to talk to MySQL,
    PHP is working fine but I dont get any mysql info when running <?
    phpinfo() ?> and get the "Call to undefined function mysql_connect() "
    when trying to connect to mysql through php in browser, please help.

    1. I have added C:\php; to the end of the environment variable path
    2. I have edited my php.ini file to :
    extension_dir = "c:\php\ext "
    extension=php_m ysql.dll - removed the ";"
    ... ive checked i only have 1 php.ini file!
    3. The dll "libmysql.d ll" is in the folder C:\php
    4. The dll "php_mysql. dll" is in the folder c:\php\ext

    I cant find any other tips, please help

    thanks
    Greg

  • ktsirig
    New Member
    • Oct 2005
    • 11

    #2
    Greg, for installing and such I used



    I am not sure whether you have done any mistake or not, but check this mini tutorilal, maybe you could get some tips!

    Comment

    • Andy Hassall

      #3
      Re: PHP5.05, Mysql4.1, Apache on Windows XP - cant get php to talk to mysql

      On 2 Oct 2005 12:24:39 -0700, "gregsands" <saunders1@gmai l.com> wrote:
      [color=blue]
      >I have read all (ok most) of the posts relating to "Call to undefined
      >function mysql_connect() ", read the manual on PHP.net and done
      >eveything thats ive been asked to do but cant get PHP to talk to MySQL,
      >PHP is working fine but I dont get any mysql info when running <?
      >phpinfo() ?> and get the "Call to undefined function mysql_connect() "
      >when trying to connect to mysql through php in browser, please help.
      >
      >1. I have added C:\php; to the end of the environment variable path
      >2. I have edited my php.ini file to :
      > extension_dir = "c:\php\ext "
      > extension=php_m ysql.dll - removed the ";"
      > ... ive checked i only have 1 php.ini file![/color]

      Is PHP reading this php.ini file? Check what it says for the configuration
      file path near the top of the phpinfo() output.
      [color=blue]
      >3. The dll "libmysql.d ll" is in the folder C:\php
      >4. The dll "php_mysql. dll" is in the folder c:\php\ext[/color]

      This and your points 1 and 2 above all look to be correct.

      Are there any errors when starting the Apache server?

      Do you have MySQL itself installed on the machine, and if so where is its
      directory on the PATH environment variable compared with PHP's copy of the
      client libraries (which are older).

      When you set PATH did you set it as a system environment variable not a user
      environment variable - else the Apache service won't see it as it doesn't run
      as your user (unless you specifically configured it that way).

      Also check permissions on the files involved for the same reason.
      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • Adam

        #4
        Re: PHP5.05, Mysql4.1, Apache on Windows XP - cant get php to talk to mysql

        On 2 Oct 2005 12:24:39 -0700, gregsands wrote:
        [color=blue]
        >I have read all (ok most) of the posts relating to "Call to undefined
        >function mysql_connect() ", read the manual on PHP.net and done
        >eveything thats ive been asked to do but cant get PHP to talk to MySQL,
        >PHP is working fine but I dont get any mysql info when running <?
        >phpinfo() ?> and get the "Call to undefined function mysql_connect() "
        >when trying to connect to mysql through php in browser, please help.
        >
        >1. I have added C:\php; to the end of the environment variable path
        >2. I have edited my php.ini file to :
        > extension_dir = "c:\php\ext "
        > extension=php_m ysql.dll - removed the ";"
        > ... ive checked i only have 1 php.ini file!
        >3. The dll "libmysql.d ll" is in the folder C:\php
        >4. The dll "php_mysql. dll" is in the folder c:\php\ext[/color]

        I've found the biggest pain in Win32 installs of PHP/MySQL to be the
        path to the PHP.INI file not being read correctly - or ditto with
        paths to extensions.

        Make some odd, highly visible (or error-producing) change to check
        that you are actually editing the right one. I've sometimes found that
        even with setting up the PATH properly, Windows seems to insist on
        having the ini file in the windows directory - even after rebooting
        etc.

        Adam.

        Comment

        • gregsands

          #5
          Re: PHP5.05, Mysql4.1, Apache on Windows XP - cant get php to talk to mysql

          Hi Andy

          OK php is looking for the php.ini file in C:\WINDOWS - so i have copied
          php.ini to C:\WINDOWS

          The PATH i set was in environment variables and the end of it looks
          like this C:\php;C:\MySQL \bin

          I get no errors when starting the Apache server

          MySQL is installed on the machine and running - i have installed
          NaviCat and it successfully connects to MySQL databases

          I checked the libmysql.dll and php_mysql.dll and found that they were
          blocked - i unblocked them, all permissions are fine

          unfortunately its still not working... :+[

          Comment

          Working...