PHP connection MySQL problem

Source: Internet
Author: User

Tag: INI file call load causes the server func file configuration mysq Local

Learn PHP connection to MySQL, using the MYSQLI mode connection encountered problems:

Call to undefined function mysqli_connect ()

Or

Class ' mysqli ' not found

In general, the extension is not found Php_mysqli.dll

PHP is connected to MySQL in 3 ways:

Php_mysql.dll PHP5 after the elimination

Php_mysqli.dll only supports MySQL connection

Php_pdo_mysql.dll can support multiple databases

Apache+php+mysql Environment Configuration issues:

1. httpd.conf configuration of Apache server:

LoadModule php7_module "E:/amp/php-7.1.5/php7apache2_4.dll"

Phpinidir e:/amp/php-7.1.5///I pit here, there is no configuration to cause

2, PHP php.ini file configuration:

Extension_dir = "E:/amp/php-7.1.5/ext"

Extension=php_mysqli.dll

Run:

<?php
$con = Mysqli_connect ("localhost:3306", "root", "123456", "dev") or Die (' Unable to connect ');
echo "Connect Success";

?>

  

PHP connection MySQL problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.