Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

PHP does not seem to be working

Post new topic   Reply to topic    Apache Forum Index -> Other Software

View previous topic :: View next topic  
Author Message

Joined: 30 Sep 2015
Posts: 17
Location: worester, usa

PostPosted: Sat 19 Jan '19 3:30    Post subject: PHP does not seem to be working Reply with quote

HI Everyone,
I have PHP 7 and Apache 2.4 installed. I also have htdocs/wordpress and htdocs/phpbb installed. When I type into my address bar

localhost/wordpress or localhost/phpbb I get this:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php:1564 Stack trace: #0 C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php(592): wpdb->db_connect() #1 C:\Apache24\htdocs\wordpress\wp-includes\load.php(409): wpdb->__construct('username_here', 'password_here', 'database_name_h...', 'localhost') #2 C:\Apache24\htdocs\wordpress\wp-settings.php(106): require_wp_db() #3 C:\Apache24\htdocs\wordpress\wp-config.php(89): require_once('C:\\Apache24\\htd...') #4 C:\Apache24\htdocs\wordpress\wp-load.php(37): require_once('C:\\Apache24\\htd...') #5 C:\Apache24\htdocs\wordpress\wp-blog-header.php(13): require_once('C:\\Apache24\\htd...') #6 C:\Apache24\htdocs\wordpress\index.php(19): require('C:\\Apache24\\htd...') #7 {main} thrown in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 1564

I don't get. I can run phpinfo(); and it works.
Any help or ideas would be much appreciated.
Thanks for the help.
Back to top

Joined: 27 Jun 2016
Posts: 91
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Sat 19 Jan '19 10:02    Post subject: Reply with quote


according to http://php.net/manual/en/function.mysql-connect.php mysql_connect() is not available in PHP7 anymore.
You have to use mysqli_connect() - see http://php.net/manual/en/function.mysqli-connect.php
Please keep in mind that this does also affect the other mysql_...-related functions which have to be replaced by mysqli_... (some functions do have other parameters than their old mysql_...-versions !!!)

Best regards
Back to top

Joined: 09 Mar 2012
Posts: 977
Location: Amsterdam, NL, EU

PostPosted: Sat 19 Jan '19 13:20    Post subject: Reply with quote

With Wordpress it is easy to switch from MySQL to MySQLi. With custom software it might not be that easy. For those people I am still building php_mysql.dll:

Sources are here:
https://pecl.php.net/package/mysql and
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Other Software
Page 1 of 1