admin管理员组文章数量:1122832
Trying to install wordpress without xamp on my local machine. Version info:
Wordpress: 5.2.3
PHP: 7.3.9
Apache: 2.4.41
When accessing this url -http://localhost:8080/wordpress/wp-admin/install.php, I see the following in wordpress logs:
[16-Sep-2019 18:47:34 UTC] PHP Fatal error: Uncaught Error: Call to
undefined function mysql_connect() in C:\apps\httpd-2.4.41-win64-
VS16\Apache24\htdocs\wordpress\wp-includes\wp-db.php:1643
I tried the solutions available online but I still see the error.
Solutions I tried so far:
Add the following to my wp-config.php:
define( 'WP_USE_EXT_MYSQL', true);
Added following to php.ini:
extension_dir = "ext"
extension=php_mysqli.dll
This is my phpinfo:
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\windows
Loaded Configuration File C:\apps\php-7.3.9\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20180731
PHP Extension 20180731
Zend Extension 320180731
Zend Extension Build API320180731,TS,VC15
PHP Extension Build API20180731,TS,VC15
Debug Build no
Thread Safety enabled
Thread API Windows Threads
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*
Trying to install wordpress without xamp on my local machine. Version info:
Wordpress: 5.2.3
PHP: 7.3.9
Apache: 2.4.41
When accessing this url -http://localhost:8080/wordpress/wp-admin/install.php, I see the following in wordpress logs:
[16-Sep-2019 18:47:34 UTC] PHP Fatal error: Uncaught Error: Call to
undefined function mysql_connect() in C:\apps\httpd-2.4.41-win64-
VS16\Apache24\htdocs\wordpress\wp-includes\wp-db.php:1643
I tried the solutions available online but I still see the error.
Solutions I tried so far:
Add the following to my wp-config.php:
define( 'WP_USE_EXT_MYSQL', true);
Added following to php.ini:
extension_dir = "ext"
extension=php_mysqli.dll
This is my phpinfo:
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\windows
Loaded Configuration File C:\apps\php-7.3.9\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20180731
PHP Extension 20180731
Zend Extension 320180731
Zend Extension Build API320180731,TS,VC15
PHP Extension Build API20180731,TS,VC15
Debug Build no
Thread Safety enabled
Thread API Windows Threads
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*
Share
Improve this question
edited Sep 16, 2019 at 19:29
Pat J
12.3k2 gold badges28 silver badges36 bronze badges
asked Sep 16, 2019 at 19:07
sotnsotn
1311 silver badge5 bronze badges
2
- did you restart apache after modifying php.ini? The error indicates it's unable to use mysqli .. so it's trying to fallback on the old mysql_* functions which were deprecated before PHP7 (and rightly so, as those functions were prone to injection). – flauntster Commented Sep 17, 2019 at 2:41
- I just ran into this myself. WP_USE_EXT_MYSQL should be set to false if you want it to use mysqli, not true. Set it to false if you want it to use mysqli. – Manachi Commented Apr 9, 2021 at 11:21
1 Answer
Reset to default 0As Pat J says, you shouldn't have define( 'WP_USE_EXT_MYSQL', true); unless you need the old mysql functions, which you do not if you're using PHP 7x and WordPress 5x. You do need to restart Apache after modifying php.ini. What do you have in your mysqli section of your phpinfo? Make sure extension_dir is set in php.ini, too. You may need to enable php.ini error logging to see if your mysqli extension is loading by setting display_startup_errors = On set error_log to [filename] or syslog.
本文标签: mysqlUncaught Error Call to undefined function mysqlconnect()Wordpress installation
版权声明:本文标题:mysql - Uncaught Error: Call to undefined function mysql_connect() - Wordpress installation 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736288830a1928176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论