Opening the error_reporting option in the php.ini file causes the MySQL extension to fail to load

Source: Internet
Author: User
Download a project source code, run with a lot of NOTICE level error, so in the php.ini file opened the error_reporting under the default Value:e_all & ~e_notice, but found that after opening will cause Call to undefined function mysql_connect () error, Connection not on database. Open Development Value:e_all | E_strict
and Production Value:e_all & ~e_deprecated are also unable to load the database module. All closed words can, I do not know if you have encountered this problem, solve ~!

Reply content:

Download a project source code, run with a lot of NOTICE level error, so in the php.ini file opened the error_reporting under the default Value:e_all & ~e_notice, but found that after opening will cause Call to undefined function mysql_connect () error, Connection not on database. Open Development Value:e_all | E_strict
and Production Value:e_all & ~e_deprecated are also unable to load the database module. All closed words can, I do not know if you have encountered this problem, solve ~!

Your mistake has error_reporting nothing to do with options, but it doesn't show errors when you close this option, but the error still exists, but it doesn't show up.

From the wrong point of view is obviously not installed on your MySQL extension, it should be noted that the current PHP default is not installed MySQL extension. If you are windows, you can find it in php.ini.

; Extension=php_mysql.dll

Remove the preceding semicolon, if you are using Ubuntu, and your PHP is apt-get installed, then you can enter it in the terminal

sudo apt-get install Php-mysql

To install the MySQL extension. If you are using other Linux distributions, you will need to recompile PHP yourself and add the Configure--with-mysql=mysqlnd

Do not know what you download the source code, I once looked at a source code, is also this error, because he is using the PDO way to load the database, but I did not open the PDO module, you can look at the code.

  • 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.