The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting up MySQLi

Discussion in 'General Discussion' started by aaroncampbell, Oct 26, 2005.

  1. aaroncampbell

    aaroncampbell Member

    Joined:
    Mar 17, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Ok, I'm REALLY new to cPanel. I've had a dedicated server for about 6 months, running CentOS 4. All I had to do to get PHP 5/MySQL 4.1 WITH MySQLi support was add the centos-pluss repository, and yum upgrade. Now I have a cPanel server running on CentOS 4, and I need to set up PHP/MySQLi. I figured out how to use the Apache Build/Upgrade section to upgrade to PHP 5.0.4, and I have MySQL 4.1, but I still don't seem to have MySQLi. I get this error in my PHP scripts:
    Fatal error: Class 'mysqli' not found in /home/... on line XXX

    I see plenty of posts about MySQLi, but none of them seem to contain simple enough instructions for a cPanel newbie to follow. Can someone help? It would be much appreciated.
     
  2. SetLar8

    SetLar8 Well-Known Member

    Joined:
    Mar 5, 2004
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Yes i would really like some help with this also.

    Thanks.
     
  3. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    What is mySQLi?
     
  4. SetLar8

    SetLar8 Well-Known Member

    Joined:
    Mar 5, 2004
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
  5. aaroncampbell

    aaroncampbell Member

    Joined:
    Mar 17, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Not exactly. People get confused here. See, there are 2 things often referred to as "mysql". The first is the Database. The second is actually the "mysql extension". This is the extension that connects PHP to mysql...allowing commands like mysql_connect to find and use the databse. It is the latter (the PHP mysql extension) that MySQLi updates. It's not an extension of the original extension, but rather a completely re-written extension, which allow PHP to use the new functionality in MySQL 4.1+. To see some of the new features, you should read Using ext/mysqli: Part I - Overview and Prepared Statements at the Zend site. It talks about some of the improvements in mysqli. Some of the highlights:
    • An object-oriented interface that allows for a use idiom that is both more convenient and easier to extend than the procedural interface
    • Support for the new MySQL binary protocol that was introduced in MySQL 4.1. (The new protocol is more efficient that the old one and allows for the support of a broader range of features, such as prepared statements.)
    • Support for the full feature set of the MySQL C client library, including the ability to set advanced connection options via mysqli_init() and related functions.
    • The extension has support for additional tracing, debugging, load balancing and replication functionality.
    • Greater speed. Enhancements in both the extension and in MySQL have made most operations faster, with certain operations becoming up to 40 times faster as compared to ext/mysql.
    • Better security. In older versions of the MySQL RDBMS, the possibility existed for an attacker to extract weak password hashes from the network and then recreate a user's password. The new authentication procedure is much more robust and mirrors the attack-resistant authentication procedure of tools like SSH.
     
Loading...

Share This Page