{"id":18,"date":"2020-08-23T00:37:02","date_gmt":"2020-08-23T05:37:02","guid":{"rendered":"https:\/\/sourceopen.com\/?p=18"},"modified":"2020-08-23T00:38:45","modified_gmt":"2020-08-23T05:38:45","slug":"fix-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in","status":"publish","type":"post","link":"https:\/\/sourceopen.com\/index.php\/fix-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in\/","title":{"rendered":"Fix: Fatal error: Uncaught Error: Call to undefined function mysql_connect() in &#8230;"},"content":{"rendered":"\n<p>When setting up my WordPress site on OpenBSD 6.7 using this <a href=\"https:\/\/www.vultr.com\/docs\/running-wordpress-on-openbsd-6-6-with-openbsd-s-httpd\" target=\"_blank\" rel=\"noreferrer noopener\">nice tutorial<\/a> I ran into an error during installation. I enabled Debug mode in WordPress by setting WP_DEBUG to true in wp-config.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG', true );<\/code><\/pre>\n\n\n\n<p>This allowed me to to see the real errors from PHP, etc. I then was handed the following error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Fatal error: Uncaught Error: Call to undefined function mysql_connect() in \u2026 &lt;path><\/code><\/pre>\n\n\n\n<p>I was able to resolve this issue by enabling the mysqli plugin in \/etc\/php-7.4.ini.<\/p>\n\n\n\n<p>Just remove the semi-colon in front of the line:<\/p>\n\n\n\n<pre id=\"block-61de29e9-ef4e-4f79-8632-3694e90dcbdd\" class=\"wp-block-code\"><code>;extension=mysqli<\/code><\/pre>\n\n\n\n<p>So after removing that semicolon in your favorite text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># grep ^extension=mysqli \/etc\/php-7.4.ini\nextension=mysqli\n#<\/code><\/pre>\n\n\n\n<p>After that was smooth sailing. This was with PHP-7.4.x on OpenBSD.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When setting up my WordPress site on OpenBSD 6.7 using this nice tutorial I ran into an error during installation. I enabled Debug mode in WordPress by setting WP_DEBUG to true in wp-config.php This allowed me to to see the &hellip; <a href=\"https:\/\/sourceopen.com\/index.php\/fix-fatal-error-uncaught-error-call-to-undefined-function-mysql_connect-in\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[4,18,16,2,17,15],"_links":{"self":[{"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/posts\/18"}],"collection":[{"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":4,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sourceopen.com\/index.php\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}