Undefined function mysql_connect()

后端 未结 14 934
庸人自扰
庸人自扰 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:14

    My guess is your PHP installation wasn't compiled with MySQL support.

    Check your configure command (php -i | grep mysql). You should see something like '--with-mysql=shared,/usr'.

    You can check for complete instructions at http://php.net/manual/en/mysql.installation.php. Although, I would rather go with the solution proposed by @wanovak.

    Still, I think you need MySQL support in order to use PDO.

提交回复
热议问题