Problems with mysql support in PHP

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Problems with mysql support in PHP

    I recently installed Red Hat Enterprise Advanced Server 3. As part of the
    install, I asked it to install MySQL and Apache 2. I have discovered that
    PHP does not seemed to have been installed with MySQL support:

    Fatal error: Call to undefined function: mysql_connect() in
    /var/www/html/test.php on line 6

    But when I look at <? phpinfo(); ?> is see:

    I see that it has been configured with --with-mysql=shared,/usr.

    Within php.conf (which gets included in the httpd.conf), is this line:

    LoadModule php4_module modules/libphp4.so

    Also when I run phpinfo() is see that --with-mysql=shared,/usr is there, so
    when php was installed it should have been compiled with MySQL support.

    php.ini says this about MySQL:


    [MySQL]
    ; Allow or prevent persistent links.
    mysql.allow_persistent = On

    ; Maximum number of persistent links. -1 means no limit.
    mysql.max_persistent = -1

    ; Maximum number of links (persistent + non-persistent). -1 means no limit.
    mysql.max_links = -1

    ; Default port number for mysql_connect(). If unset, mysql_connect() will
    use
    ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    ; compile-time value defined MYSQL_PORT (in that order). Win32 will only
    look
    ; at MYSQL_PORT.
    mysql.default_port =

    ; Default socket name for local MySQL connects. If empty, uses the built-in
    ; MySQL defaults.
    mysql.default_socket =

    ; Default host for mysql_connect() (doesn't apply in safe mode).
    mysql.default_host =

    ; Default user for mysql_connect() (doesn't apply in safe mode).
    mysql.default_user =

    ; Default password for mysql_connect() (doesn't apply in safe mode).
    ; Note that this is generally a *bad* idea to store passwords in this file.
    ; *Any* user with PHP access can run 'echo
    get_cfg_var("mysql.default_password")
    ; and reveal this password! And of course, any users with read access to
    this
    ; file will be able to reveal the password as well.
    mysql.default_password =

    ; Maximum time (in secondes) for connect timeout. -1 means no limimt
    mysql.connect_timeout = -1

    ; Trace mode. When trace_mode is active (=On), warnings for table/index
    scans and
    ; SQL-Erros will be displayed.
    mysql.trace_mode = Off


    Also, I see mysql.so at
    ../usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
    ql.so

    Do I need to declare this in php.ini? Such as:

    extension=mysql.so

    Any HELP would me appreciated!


    jbottero Guest

  2. Similar Questions and Discussions

    1. #39369 [NEW]: PHP 5.2.0 will not compiled with MySQL support
      From: nathan at officelink dot net dot au Operating system: FreeBSD 6.1-RELEASE-p10 PHP version: 5.2.0 PHP Bug Type: Compile...
    2. #25447 [Opn->Bgs]: No built-in support for MySql
      ID: 25447 Updated by: magnus@php.net Reported By: ondrejspilka at centrum dot cz -Status: Open +Status: ...
    3. #25447 [Opn]: No built-in support for MySql
      ID: 25447 User updated by: ondrejspilka at centrum dot cz -Summary: No built-in support fro MySql Reported By: ...
    4. Where do I activate mysql support?
      I run php pages in IIS in cgi-mode(only pointing them to PHP.exe). But I can't connect to database: Fatal error: Call to undefined function:...
    5. PHP5 and MySQL support
      Anyone knows how i can run PHP5 with mysql support under win2k? Do i have to compile it? isnt there any other solution? Thanks in advance
  3. #2

    Default Re: Problems with mysql support in PHP


    Had the same problem with debian.
    apt-get php4-mysql

    It solved the problem.
    -JI

    jbottero wrote:
    > I recently installed Red Hat Enterprise Advanced Server 3. As part of the
    > install, I asked it to install MySQL and Apache 2. I have discovered that
    > PHP does not seemed to have been installed with MySQL support:
    >
    > Fatal error: Call to undefined function: mysql_connect() in
    > /var/www/html/test.php on line 6
    >
    > But when I look at <? phpinfo(); ?> is see:
    >
    > I see that it has been configured with --with-mysql=shared,/usr.
    >
    > Within php.conf (which gets included in the httpd.conf), is this line:
    >
    > LoadModule php4_module modules/libphp4.so
    >
    > Also when I run phpinfo() is see that --with-mysql=shared,/usr is there, so
    > when php was installed it should have been compiled with MySQL support.
    >
    > php.ini says this about MySQL:
    >
    >
    > [MySQL]
    > ; Allow or prevent persistent links.
    > mysql.allow_persistent = On
    >
    > ; Maximum number of persistent links. -1 means no limit.
    > mysql.max_persistent = -1
    >
    > ; Maximum number of links (persistent + non-persistent). -1 means no limit.
    > mysql.max_links = -1
    >
    > ; Default port number for mysql_connect(). If unset, mysql_connect() will
    > use
    > ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
    > ; compile-time value defined MYSQL_PORT (in that order). Win32 will only
    > look
    > ; at MYSQL_PORT.
    > mysql.default_port =
    >
    > ; Default socket name for local MySQL connects. If empty, uses the built-in
    > ; MySQL defaults.
    > mysql.default_socket =
    >
    > ; Default host for mysql_connect() (doesn't apply in safe mode).
    > mysql.default_host =
    >
    > ; Default user for mysql_connect() (doesn't apply in safe mode).
    > mysql.default_user =
    >
    > ; Default password for mysql_connect() (doesn't apply in safe mode).
    > ; Note that this is generally a *bad* idea to store passwords in this file.
    > ; *Any* user with PHP access can run 'echo
    > get_cfg_var("mysql.default_password")
    > ; and reveal this password! And of course, any users with read access to
    > this
    > ; file will be able to reveal the password as well.
    > mysql.default_password =
    >
    > ; Maximum time (in secondes) for connect timeout. -1 means no limimt
    > mysql.connect_timeout = -1
    >
    > ; Trace mode. When trace_mode is active (=On), warnings for table/index
    > scans and
    > ; SQL-Erros will be displayed.
    > mysql.trace_mode = Off
    >
    >
    > Also, I see mysql.so at
    > ./usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
    > ql.so
    >
    > Do I need to declare this in php.ini? Such as:
    >
    > extension=mysql.so
    >
    > Any HELP would me appreciated!
    >
    >
    Jamie Isaacs Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139