Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member ricoche's Avatar
    Join Date
    Feb 2003
    Posts
    108

    Default Need help from an experienced php5/mysql5/Cpanel Expert

    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. #2
    Member ricoche's Avatar
    Join Date
    Feb 2003
    Posts
    108

    Default

    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. #3
    Member ricoche's Avatar
    Join Date
    Feb 2003
    Posts
    108

    Default

    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

Similar Threads & Tags
Similar threads

  1. MySQL4.1 or MySQL5 for PHP5
    By anoetic in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-06-2007, 06:23 AM
  2. cpanel php5 & mysql5 support
    By glowico in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 12-28-2005, 03:27 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube