Hi, I stumbled on this today, I'm new to PHP (been using Perl and MySQL for about 4 years).

I am getting the same behavior that piersk reported -- when I attempt a mysql_connect(), I get

Fatal error: Call to undefined function: mysql_connect()

I looked at php.ini, and it has both

enable_dl=On

and

extension = mysql.so

as tsinka suggested.

I'm using PHP 4.2.2 on RedHat 8 running Apache 2.0.40

    AlChuck, see my post directly above. I'll bet that if you run

    locate mysql.so

    you come up with nothing. You need to get mysql.so installed in your PHP library somehow (I had to RPM it in with --force).

      I saw your post, shacker... but in my case I do have mysql.so in my extensions dir. When I do locate mysql.so, I get

      /usr/lib/php4/mysql.so

      along with those for python, perl, and DBD-mysql in their various directories...

        Ah, sorry. I guess the next step would be to verify (with phpinfo(); ) that PHP is actually looking in that location for libraries.

          OK, let's see what that shows...

          under Configuration/PHP Core

          extension_dir is /usr/lib/php4 for both local and master values.

          Are there any other relevant settings? None jump out at me.

            What distribution are you running?

              I installed it off the RedHat 8 CD-ROMs, it was one of the packages I selected.

              I'm getting close to re-installing it fresh but if it's just something fairly simple I'd rather figure it out...

                Bump... still hoping for another idea about what might be wrong before I go reinstall...

                  Wow.

                  I wake up this morning and I'm getting exactly the same problem.

                  It was literally working at 2am this morning. I wake up at 10am and it's got the:

                  Fatal error: Call to undefined function: mysql_connect() in

                  error.

                  I checked the php.ini file, everything is where it should be.

                  phpMyAdmin is also working fine.

                  I've got InvisionBoard installed, and that's the script I get the error with.

                  What to do 🙁

                    14 days later

                    Hello

                    I'm having the same trouble but the only folder I have it in (mysql.so) is: usr/lib/perl5

                    So, I guess I'm asking what is the next step for a noob?

                    Thanks.....

                    Originally posted by shacker
                    Ah, sorry. I guess the next step would be to verify (with phpinfo(); ) that PHP is actually looking in that location for libraries.

                      Found the problem with mine.

                      Our technical guy editted php.ini to allow PHP to use more memory.

                      A line wrapped underneath another and somehow caused the problem.

                        ComputerHavoc,

                        There's a different mysql.so file for Perl. Sounds like you are missing the PHP one.

                        Did you check all the other stuff in the earlier part of this thread (the ini file, whether PHP was compiled with mysql support, etc.)?

                        cbn_noodles,

                        I'm a little confused. I can imagine a wrapped line could be a syntax foul and cause a line not to be read... but what does it have to do with a memory setting? Was your tech guy just trying anything he could think of and then discovered the wrongly-wrapped line? Was it the line involving where the library file was? Any other info you can give would be great...

                          Write a Reply...