Undefined function mysqli_connect () in XX. The connection database appears mysqli_connect () undefined problem.

Source: Internet
Author: User
Tags install php phpinfo

This is my PHP code in the implementation of a mistake, I have been on the internet for a long time, but also in accordance with the methods commonly used on the Internet to modify, have no effect.

For example: 1. Create a new PHP file:

<?php
Print phpinfo ();

?>

To execute this file, you can view all the information in PHP.

You can see no php.ini configuration file. Go to PHP installed directory to view, and no php.ini config file, only php.ini-production. Online said as long as the php.ini-production file to php.ini on it. Then open the configuration file, 1. Remove the colon in front of Extension_dir = "ext" and change Extension_dir = "ext" to the absolute path of your installation, for example: Extension_dir = "C:/develop/php/ext". 2. Remove the colon in front of the extension=mysqli. Save and restart Apache.

The execution of the file, or the same error did not occur. See Phpinfo, still no php.ini.

The above configuration is not wrong, but when installing Apache, the configuration file path of PHP is not configured.

This is the time to install PHP in the Apache httpd.conf in the configuration of PHP.

Add a sentence below: Phpinidir "C:/develop/php/php.ini", this path is the path where the php.ini configuration file resides.

Save and restart Apache.

With Phpinfo view, you can see the following:

Description mysqli extension file is open, then go to execute PHP file, it is possible.

Undefined function mysqli_connect () in XX. The connection database appears mysqli_connect () undefined 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.