Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hi i have redhat -el3 . php-4.3.2. mysql - 5.0.18 standard. php was already pre-installed while installing redhat . recently, i installed mysql . now, when i am accessing a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6

    php-mysql connection problem mysql-pconnect..


    Hi i have redhat -el3 . php-4.3.2. mysql - 5.0.18 standard. php was already pre-installed while installing redhat . recently, i installed mysql . now, when i am accessing a php web page in a project , the message Fatal error: Call to undefined function: mysql_pconnect() is displayed in the browser.

    i have the following the packages installed in it.
    1.mySQL-client-standard-5.0.18-0.rhel3.i386.rpm
    2.MySQL-devel-standard-5.0.18-0.rhel3.i386.rpm
    3.MySQL-server-standard-5.0.18-0.rhel3.i386.rpm
    4.MySQL-shared-standard-5.0.18-0.rhel3.i386.rpm
    5. php-mysql-4.3.2-19.0.rhel3.kde.i386.rpm


    it will be much help full, if any one can help me to to fix the isssue.

  2. #2
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    Is mysql running? Test it on the commandline.
    Is mysql running :?
    Type this to make sure: netstat -vat |grep sql
    The reply should be: tcp 0 0 *:mysql *:* LISTEN
    Or mysqlshow: shows the databases currently in use, probably the only you have now is test.
    source: nerdstuffs
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6
    Hi,

    mysql is working fine. i gave the command , it ressmebles the same.i hope there is no problem in mysql, since my mysql is being used.

    Thanks in advance
    Rizwan

  4. #4
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    What does phpinfo say about mysql? Is it configured?
    Testing For PHP and MySQL
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

  5. #5
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6
    hi,

    i have upgraded the php to 5.1.6. (configured with mysql) and ran the phpinfo, it works fine and i have installed php-mysql-5.1.6-2.i386.rpm too.. Still i get the same error.

    Fatal error: Call to undefined function mysql_pconnect()


    Thanks in advance
    Rizwan

  6. #6
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    Start testing some normal stuff like a normal connect instead of the pconnect, like here:
    http://linuxboxadmin.com/src/db-rw.php.txt:
    $mysql = mysql_connect("localhost","xxxx","xxxx")
    or die("problem connecting to mysql");
    Follow the link for the full script and save that as .php
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

  7. #7
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6
    hi,

    i have tried it and says the following

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

    i have upgraded to php 5.1.6 and did

    rpm -qa |grep php

    php-mysql-5.1.6-2
    php-mysql-4.3.2-19.0.rhel3.kde
    php-4.3.2-26.ent
    php-ldap-4.3.2-26.ent
    php-imap-4.3.2-26.ent

    and when i give phpinfo ()

    it gives the following

    Configure Command './configure' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mysql=shared,/usr' '--enable-memory-limit' '--enable-ftp'
    Server API Apache 2.0 Handler
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /usr/local/lib/php.ini
    PHP API 20041225
    PHP Extension 20050922
    Zend Extension 220051025
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    IPv6 Support enabled
    Registered PHP Streams php, file, http, ftp
    Registered Stream Socket Transports tcp, udp, unix, udg
    Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*

    Thanks in advance
    Rizwan

  8. #8
    Linux User muha's Avatar
    Join Date
    Jan 2006
    Posts
    290
    What about if you access mysql from the commandline, test this:
    Code:
    mysql -p -e"SHOW DATABASES;"
    Run a mysql query from the commandline.

    /edit:
    Ah, googling on that error gave me this:
    http://www.php.net/manual/en/faq.dat...ses.mysql.php5
    4. PHP 5 no longer bundles MySQL client libraries, what does this mean to me? Can I still use MySQL with PHP? I try to use MySQL and get "function undefined" errors, what gives?
    Are you sure about this option:? --with-mysql=shared,/usr
    I think you need to restart your apache to test changes you made.
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

  9. #9
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6
    hi,

    i am able to access the mysql from command prompt.

    Are you sure about this option --with-mysql=shared,/usr
    I think you need to restart your apache to test changes you made.
    when i have php 4.3.2, that time i got this (--with-mysql=shared,/usr)from phpinfo().. that time also , i am not able to get it connected to mysql from PHP.

    so when upgrading the to php5.1.6, i do the same.. (--with-mysql=shared,/usr) while installing the php.. ?

    how do i make sure this please?

    Thanks in advance
    Rizwan

  10. #10
    Just Joined!
    Join Date
    Oct 2006
    Posts
    6
    hi,

    i have restartd the apache and tested , still i get the same error

    it will be very much helpfull, if any one can help me in fixing the error..

    Thanks in advance
    Rizwan

Page 1 of 2 1 2 LastLast

Posting Permissions

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