Connection to mysql working in eclipse but not on apache?

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

    #1

    Connection to mysql working in eclipse but not on apache?

    I have installed apache, php5 and mysql on my laptop.

    I write my code in eclipse and when I test it inside eclipse, the mysql
    database connection is working, I can execute the script inside
    eclipse. But when I put that same script into my htdocs on the apache
    server running on the same laptop and access it using my browser, I get
    a "Call to undefined function mysql_connect() " error message.

  • Colin McKinnon

    #2
    Re: Connection to mysql working in eclipse but not on apache?

    frustratedcoder wrote:
    [color=blue]
    > I have installed apache, php5 and mysql on my laptop.
    >
    > I write my code in eclipse and when I test it inside eclipse, the mysql
    > database connection is working, I can execute the script inside
    > eclipse. But when I put that same script into my htdocs on the apache
    > server running on the same laptop and access it using my browser, I get
    > a "Call to undefined function mysql_connect() " error message.[/color]

    Not familiar with using PHP in Eclipse, but it sounds as if your module is
    not loading the MySQL extension. Try phpinfo() on both systems to see where
    it's reading the ini from, and how the paths are setup. Make sure the
    webserver isn't running chroot (or that the chroot environment is correctly
    configured).

    C.

    Comment

    • David Haynes

      #3
      Re: Connection to mysql working in eclipse but not on apache?

      frustratedcoder wrote:[color=blue]
      > I have installed apache, php5 and mysql on my laptop.
      >
      > I write my code in eclipse and when I test it inside eclipse, the mysql
      > database connection is working, I can execute the script inside
      > eclipse. But when I put that same script into my htdocs on the apache
      > server running on the same laptop and access it using my browser, I get
      > a "Call to undefined function mysql_connect() " error message.
      >[/color]
      Have you copied libmysql.dll into the apache2\bin directory?

      -david-

      Comment

      • frustratedcoder

        #4
        Re: Connection to mysql working in eclipse but not on apache?

        I tried phpinfo on both setup's and they appear to be loading the same
        php.ini file, both using the file located at c:\windows\php5 .

        What is chroot

        Comment

        Working...