简体   繁体   中英

Call to undefined function mysql_connect() Apache + Mysql error

I have a Ubuntu server which runs the Dokuwiki and projects system for our LAN

When users access the Dokuwiki they get the dreaded

No ACL setup yet! Denying access to everyone.

and on the projects system appears with the login but once logged in this error appears

Fatal error: Call to undefined function mysql_connect() in /data/projects/common_code_1/class.Database.php on line 78

Could anyone point me in the right direction?

I have restarted Apache and MySQL but still persists, is it a PHP error?

Please help

You need to install the proper PHP library. Your wiki seems to need "mysql" which is deprecated. Please update your wiki to a newer version that uses mysqli or you will loose support for it soon.

sudo apt-get install php-mysql

Check for below settings in php.ini

extension=php_mysql.dll
extension=php_mysqli.dll

Create a php file with below code <?php phpinfo(); exit(); ?> <?php phpinfo(); exit(); ?> <?php phpinfo(); exit(); ?> and load it in your browser. Search the page for MySQL. If you don't see it, you need to recompile PHP with MySQL support, or reinstall a PHP package that has it built-in

Please Restart your Apache and Mysql .Or You can find in 'Apache Error Log'. Or change the display errors 'off' to 'on' in 'php.ini' file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM