PHP not supporting MySQL

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

    #1

    PHP not supporting MySQL

    My PHP version is obviously not compiled with MySQL support,
    consequently I get the following message:-

    Fatal error: Call to undefined function mysql_connect() in
    C:\http-dir\board\conne ct.php on line 3

    Question:- How do I instruct PHP to support MySQL?

    Please note:-

    extension=php_m ysql.dll
    extension=php_p do_mysql.dll

    in php.ini are enabled, and php.ini is located in the php root directory.

    Thank you.
  • Vincent

    #2
    Re: PHP not supporting MySQL

    be sure libmysql.dll is available to the systems PATH.

    from php.net:

    Go to Control Panel and open the System icon (Start -Settings ->
    Control Panel -System, or just Start -Control Panel -System for
    Windows XP/2003)

    Go to the Advanced tab

    Click on the 'Environment Variables' button

    Look into the 'System Variables' pane

    Find the Path entry (you may need to scroll to find it)

    Double click on the Path entry

    Enter your PHP directory at the end, including ';' before (e.g. ;C:\php)

    Press OK and restart your computer




    hope this helps

    Siegfreed schreef:
    My PHP version is obviously not compiled with MySQL support,
    consequently I get the following message:-
    >
    Fatal error: Call to undefined function mysql_connect() in
    C:\http-dir\board\conne ct.php on line 3
    >
    Question:- How do I instruct PHP to support MySQL?
    >
    Please note:-
    >
    extension=php_m ysql.dll
    extension=php_p do_mysql.dll
    >
    in php.ini are enabled, and php.ini is located in the php root directory.
    >
    Thank you.

    Comment

    • Jerry Stuckle

      #3
      Re: PHP not supporting MySQL

      Siegfreed wrote:
      My PHP version is obviously not compiled with MySQL support,
      consequently I get the following message:-
      >
      Fatal error: Call to undefined function mysql_connect() in
      C:\http-dir\board\conne ct.php on line 3
      >
      Question:- How do I instruct PHP to support MySQL?
      >
      Please note:-
      >
      extension=php_m ysql.dll
      extension=php_p do_mysql.dll
      >
      in php.ini are enabled, and php.ini is located in the php root directory.
      >
      Thank you.
      First of all, there's no need to change the registry if you have your
      php.ini file in the right place.

      Secondly, there are three extensions you could be interested in.

      extension=php_m ysql.dll // (older) mysql_xxx interface
      extension=php_m ysqli.dll // (newer) mysqli_xxx objects
      extension=php_p do_mysql.dll // (newest) PDO interface for MySQL
      extension=php_p do.dll // also required for PDO

      (note: the last, PHP Data Objects, is an abstraction layer for data
      access. It's relatively new, so you probably won't see much existing
      code using it.

      Most sites use the mysql_xxx interface, while there are some going to
      the mysqli_interfac e.

      And the interfaces are quite compatible - you can load all three and
      pick whichever one you want to use in your code.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • denis

        #4
        Re: PHP not supporting MySQL


        "Siegfreed" <sieg@freed.org wrote in message
        news:45c98787$0 $11603$afc38c87 @news.optusnet. com.au...
        My PHP version is obviously not compiled with MySQL support, consequently
        I get the following message:-
        >
        Fatal error: Call to undefined function mysql_connect() in
        C:\http-dir\board\conne ct.php on line 3
        >
        Question:- How do I instruct PHP to support MySQL?
        >
        Please note:-
        >
        extension=php_m ysql.dll
        extension=php_p do_mysql.dll
        >
        in php.ini are enabled, and php.ini is located in the php root directory.
        >
        Thank you.
        Along with the previous advice to add PHP dir to your system path, from the
        top of my head

        1) Run phpinfo() and see if the report displays the correct path to your
        php.ini
        2) Uncomment extension_dir in php.ini and set it to the appropriate folder

        Something along the lines of
        extension_dir = "C:\PHP\ext \"


        p.s I do hope you installed PHP from the binary zip, not the installer, as
        the second one doesn't include mysql support to my knowledge


        Denis Gerina


        Comment

        • Siegfreed

          #5
          Re: PHP not supporting MySQL

          I copied "libmysql.d ll", and "php.ini" to the system PATH, and the
          "fatal error" message disappeared. I will modify the system PATH (as
          you suggested) if for some reason I need the "php.ini" in the in the
          "php" directory.

          Thank you.

          Vincent wrote:
          be sure libmysql.dll is available to the systems PATH.
          >
          from php.net:
          >
          Go to Control Panel and open the System icon (Start -Settings ->
          Control Panel -System, or just Start -Control Panel -System for
          Windows XP/2003)
          >
          Go to the Advanced tab
          >
          Click on the 'Environment Variables' button
          >
          Look into the 'System Variables' pane
          >
          Find the Path entry (you may need to scroll to find it)
          >
          Double click on the Path entry
          >
          Enter your PHP directory at the end, including ';' before (e.g. ;C:\php)
          >
          Press OK and restart your computer
          >
          >
          >
          hope this helps
          >
          Siegfreed schreef:
          >
          >My PHP version is obviously not compiled with MySQL support,
          >consequently I get the following message:-
          >>
          >Fatal error: Call to undefined function mysql_connect() in
          >C:\http-dir\board\conne ct.php on line 3
          >>
          >Question:- How do I instruct PHP to support MySQL?
          >>
          >Please note:-
          >>
          >extension=php_ mysql.dll
          >extension=php_ pdo_mysql.dll
          >>
          >in php.ini are enabled, and php.ini is located in the php root directory.
          >>
          >Thank you.

          Comment

          • Siegfreed

            #6
            Re: PHP not supporting MySQL

            Jerry Stuckle wrote:
            Siegfreed wrote:
            >
            >My PHP version is obviously not compiled with MySQL support,
            >consequently I get the following message:-
            >>
            >Fatal error: Call to undefined function mysql_connect() in
            >C:\http-dir\board\conne ct.php on line 3
            >>
            >Question:- How do I instruct PHP to support MySQL?
            >>
            >Please note:-
            >>
            >extension=php_ mysql.dll
            >extension=php_ pdo_mysql.dll
            >>
            >in php.ini are enabled, and php.ini is located in the php root directory.
            >>
            >Thank you.
            >
            >
            First of all, there's no need to change the registry if you have your
            php.ini file in the right place.
            >
            Secondly, there are three extensions you could be interested in.
            >
            extension=php_m ysql.dll // (older) mysql_xxx interface
            extension=php_m ysqli.dll // (newer) mysqli_xxx objects
            extension=php_p do_mysql.dll // (newest) PDO interface for MySQL
            extension=php_p do.dll // also required for PDO
            >
            (note: the last, PHP Data Objects, is an abstraction layer for data
            access. It's relatively new, so you probably won't see much existing
            code using it.
            >
            Most sites use the mysql_xxx interface, while there are some going to
            the mysqli_interfac e.
            >
            And the interfaces are quite compatible - you can load all three and
            pick whichever one you want to use in your code.
            >
            I think you are right in saying: "there's no need to change the registry
            if you have your php.ini file in the right place". By moving the
            "php.ini" to "c:\windows ", the "fatal error" message was eliminated.

            In addition, I copied "libmysql.d ll" to "c:\windows ", it appears to work
            fine so far.

            Thank you.

            Comment

            • otrWalter@gmail.com

              #7
              Re: PHP not supporting MySQL

              I think you are right in saying: "there's no need to change the registry
              if you have your php.ini file in the right place". By moving the
              "php.ini" to "c:\windows ", the "fatal error" message was eliminated.
              >
              In addition, I copied "libmysql.d ll" to "c:\windows ", it appears to work
              fine so far.
              I knew some would get around to saying they copied files into C:
              \WINDOWS.

              There is no reason to place ANYTHING in C:\windows.

              No reason to modify the registry (I don't consider ENV VARS registry,
              yes I know, that's where it lives, but...)

              go to



              I have complete docs that explain how to set up Apache and PHP without
              doing on of this "windows-centric" stuff.

              In fact, I had to replace my OS drive last week. Took my 2 hours to
              reinstall XP Pro and the drivers and the like.

              It took my 10 minutes to "reinstall" Apache, mySQL, Perl, PHP and
              SSH2, along with 90% of linux command line tools.

              See if that method helps you.

              Walter

              Comment

              • Jerry Stuckle

                #8
                Re: PHP not supporting MySQL

                otrWalter@gmail .com wrote:
                >I think you are right in saying: "there's no need to change the registry
                >if you have your php.ini file in the right place". By moving the
                >"php.ini" to "c:\windows ", the "fatal error" message was eliminated.
                >>
                >In addition, I copied "libmysql.d ll" to "c:\windows ", it appears to work
                >fine so far.
                >
                I knew some would get around to saying they copied files into C:
                \WINDOWS.
                >
                There is no reason to place ANYTHING in C:\windows.
                >
                That's one opinion. I happen to keep certain configuration files there.
                No reason to modify the registry (I don't consider ENV VARS registry,
                yes I know, that's where it lives, but...)
                >
                Changing the environment *is* changing the registry. And environment
                changes are applied to every program loaded, not just the one process
                reading the configuration file. My environment is already 3K long -
                without adding unnecessary things to it.
                go to
                >

                >
                I have complete docs that explain how to set up Apache and PHP without
                doing on of this "windows-centric" stuff.
                >
                There is nothing wrong with making use of the tools at hand.
                In fact, I had to replace my OS drive last week. Took my 2 hours to
                reinstall XP Pro and the drivers and the like.
                >
                Good for you. I lost my hard drive. It took me 4 days to reinstall
                Windows 2K, apply all of the patches and restore from backup. Next step
                is a better backup program.
                It took my 10 minutes to "reinstall" Apache, mySQL, Perl, PHP and
                SSH2, along with 90% of linux command line tools.
                >
                Didn't even take me that long. Once the OS was restored, it was a
                simple matter to restore the rest of the system (about 40GB).
                See if that method helps you.
                >
                Walter
                >


                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                Working...