Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Need help from an experienced php5/mysql5/Cpanel Expert

Discussion in 'General Discussion' started by ricoche, Aug 30, 2006.

  1. ricoche

    ricoche Well-Known Member

    Joined:
    Feb 7, 2003
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    Hello,

    I happen to have Mysql5.0.24, PHP5.1.6, and Cpanel 10.9.0-C3 all running very nicely on my test server right now. No problems.

    Now, I understand that PHP4 script may or may not run on this environment. To test a few scripts I uploaded them and consistently have been getting the following error on everything I have ever programmed.

    Call to undefined function mysql_connect()

    I read the manual over on php.net found the following:

    MySQL is not enabled by default, nor is the MySQL library bundled with PHP. Read this FAQ for details on why. Use the --with-mysql[=DIR] configure option to include MySQL support. You can download headers and libraries from MySQL.

    I'm curious whether those users who have a similar server/cpanel setups have encountered similar errors. Have I compiled PHP5 incorrectly?

    Note I checked "Use System Mysql" and NOT "Mysql Module".

    Also, here is an excerpt of my phpinfo file for the extensions.

    './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-magic-quotes' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-zlib'

    Do I need to code mysql_connect() differently? Compile something new?

    Again, I'll probably have to recode my scripts, but for now I can't even get to first base. <laugh>

    Any help from experienced php5/mysql5 users would be much appreciated. Also, note that this may be a more php question than anything, but I compiled using Cpanel, so I'm thinking I may have done something incorrectly.

    Thanks again,

    Jim
     
  2. ricoche

    ricoche Well-Known Member

    Joined:
    Feb 7, 2003
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    People are telling me I need to compile the MySQL Libraries into PHP, but I'm not sure how this is done. Perhaps I need to configure easyapache differently, modify my php.ini file, or install some sort of rpm to have this work.

    Thanks again,

    Jim
     
  3. ricoche

    ricoche Well-Known Member

    Joined:
    Feb 7, 2003
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    166
    PROBLEM SOLVED!

    I manually compiled PHP 5.1.6 with the mysql and mysqli extensions. My php scripts now connect and work perfectly with everything on the server! I'm not sure what I did wrong if anything when compiling first via easyapache, but it looks like I had to manually compile PHP in order to get mysql working to the required specs. Oh well, it works now.

    Jim
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice