Undefined function mysql_connect()

后端 未结 14 801
庸人自扰
庸人自扰 2020-11-22 10:56

I have ran aptitude install php5-mysql (and restarted MySQL/Apache 2), but I am still getting this error:

Fatal error: Call to undefined

14条回答
  •  渐次进展
    2020-11-22 11:22

    The question is tagged with ubuntu, but the solution of un-commenting the extension=mysqli.dll is specific to windows. I am confused here?!, anyways, first thing run and search for mysql* under Configuration heading. If you don't see such a thing implies you have not installed or enabled php-mysql. So first install php-mysql

    sudo apt get install php-mysql

    This command will install php-mysql depending on the php you have already installed, so no worries about the version!!.

    Then comes the unix specific solution, in the php.ini file un-comment the line

    extension=msql.so
    

    verify that msql.so is present in /usr/lib/php/, ELSE

    extension=path/to/msql.so
    

    Then finally restart the apache and mysql services, and you should now see the mysql section under Configrations heading in phpinfo page

提交回复
热议问题