Click here to Skip to main content
15,889,693 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I tried to install Wordpress because I wanted to verify that MySQL was installed properly to use as a web-environment for data-base simulation and presentation. I wanted to verify that I could web-script using C++, so my thought flow was to get the standard setup in place for WordPress (so that I know that the database is accessible from the web) using a local copy of the web-server Apache.

I adjusted the configuration file and all for Wordpress, but I still get the error message
C#
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.


My Troubleshooting Approach
1. I tried adjusting the wpconfig file after setting up the database with MySQL - that did not resolve the issue.
2. I tried looking at phpinfo with a simple test file test.php:
<?php phpinfo();

-The good news is that phpinfo comes up. The bad news is I am having trouble with two things: 1) What does a good phpinfo file look like when mySQL is installed properly? and 2) I do not see mysql there properly. Is it there, and if not, what can be done to troubleshoot this issue further?

My php file can be seen here:

http://www.gonorthwork.com/view/2016-02-03T10:46:34+00:00-phpinfo%28%29.pdf[1]

3. I did not see so clearly in the php information output that the modules were getting loaded. So I tried to get php code that would specifically give me the list of modules loaded:

PHP
<?php
/*Code sample from http://php.net/manual/en/function.get-loaded-extensions.php to show the loaded modules*/
print_r(get_loaded_extensions());

/*Code example (edited) from:  http://php.net/manual/en/mysqli.query.php 
*/

/*Original mysqli connector example*/
/* $mysqli = new mysqli("localhost", "my_user", "my_password", "world");*/

$mysqli = new mysqli("localhost", "wordpressdb", "your_selected_password", "wordpressdb");

/* check connection */
if ($mysqli->connect_errno) {
    printf("Connect failed: %s\n", $mysqli->connect_error);
    exit();
}
$mysqli->close();  /*Close the database*/
?>


It turned out that the mysql mysqli modules were not being loaded.

So I need to file that as a separate question.

I am working around it by using the database in open office which worked fine (but only with the plugin driver - which I remember being an issue from before, so there is no new issue with MySQL), so the operating system is not blocking the database. As an aside, I adjusted the windows firewall so that it should not be blocking the port used by the database.


Questions
1. How can I get the installation fixed so Wordpress comes up?
2. How can I demonstrate C++ scripting via the web?
3. How can I demonstrate a C++ plugin that accesses the database and the web?

Resolution

The issue ended up being with the configuration file for Apache! Updating this part of Apache Web Server's httpd.conf file a follows resolved it, and now the WordPress installation works fine. The C++ scripting and C++ plugin is getting deferred slightly, since a php script was written that works to connect to the database. So if needed, a php script can write a file to connect to the C++ program, or most likely the database library would also work (still needs testing, but lower risk since there is a workaround path that has been established).

#Intallation of the php mode per:  https://wordpress.org/support/topic/missing-the-mysql-extension-1   
#This LoadModule is not available
#LoadModule php5_module modules/libphp5.so
LoadModule php5_module "C:/PHP/php5apache2_4.dll"
PHPIniDir C:/PHP

#First option - only php files
#<FilesMatch \.php$>
#SetHandler application/x-httpd-php
#</FilesMatch>

#Second option - php  .php, .php2, .php3, .php4, .php5, .php6, and .phtml files to be executed as PHP
<FilesMatch "\.ph(p[2-6]?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>

#Third option -  And to allow .phps files to be executed as PHP source files, add this:

<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>


References Part I- Research That I tried to Resolve the Issue

C#
Web Scripting C++ and CGI


From Send Tab URLs (44 links)


1. Web Scripting C++ and CGI
http://www.quackit.com/html/online-html-editor/full/

2. c++ web scripting - -Google


3. C++ Web Programming
http://www.tutorialspoint.com/cplusplus/cpp_web_programming.htm

4. download apache - Google


5. Download - The Apache HTTP Server Project
https://httpd.apache.org/download.cgi

6. running ubuntu 10.10 under a virtual machine -Google

7. Installing Ubuntu 10.4 LTS on Windows Virtual PC on Windows 7 - Scott Hanselman
http://www.hanselman.com/blog/InstallingUbuntu104LTSOnWindowsVirtualPCOnWindows7.aspx

8. virtualbox - Install Ubuntu 10.10 on Virtual Machine - Ask Ubuntu
http://askubuntu.com/questions/10671/install-ubuntu-10-10-on-virtual-machine

9. Ubuntu | VirtualBoxes - Free VirtualBox® Images
http://virtualboxes.org/images/ubuntu/

10. VirtualBoxes - Free VirtualBox(R) Images download | SourceForge.net
http://sourceforge.net/projects/virtualboximage/?source=typ_redirect

11. VirtualBoxes - Free VirtualBox(R) Images download | SourceForge.net
http://sourceforge.net/projects/virtualboximage/?source=typ_redirect

12. Ubuntu PC operating system | Ubuntu
http://www.ubuntu.com/desktop

15. Apache HTTP Server - Download
http://apache-http-server.en.softonic.com/

17. Manual install on Windows 7 with Apache and MySQL - MoodleDocs
https://docs.moodle.org/29/en/Manual_install_on_Windows_7_with_Apache_and_MySQL

18. phpinfo()
http://localhost/test.php

19. http://localhost/
http://localhost/

20. php - PHP7 : Missing VCRUNTIME140.dll - Stack Overflow
http://stackoverflow.com/questions/30811668/php7-missing-vcruntime140-dll

21. Download Visual C++ Redistributable for Visual Studio 2015 from Official Microsoft Download Center
https://www.microsoft.com/en-us/download/confirmation.aspx?id=48145

22. PHP: Downloads
http://php.net/downloads.php

23. PHP For Windows: Binaries and sources Releases
http://windows.php.net/download#php-5.5


25. Apache VC14 binaries and modules download
http://www.apachelounge.com/download/

26. MySQL :: MySQL on Windows
http://dev.mysql.com/downloads/windows/

28. MySQL :: MySQL Connectors
http://dev.mysql.com/downloads/connector/

29. MySQL :: Download MySQL Workbench
http://dev.mysql.com/downloads/workbench/

33. Mini Bar Ideas for Home | DesignRulz
http://www.designrulz.com/design/2013/09/mini-bar-ideas-for-home/

34. לוח בקרה למשתמש • התחבר - www.4project.co.il
https://www.4project.co.il/forum/ucp.php?mode=login

35. mysql roles -Google


36. MySQL :: MySQL Workbench Manual :: 6.2 Users and Privileges
https://dev.mysql.com/doc/workbench/en/wb-mysql-connections-navigator-management-users-and-privileges.html

37. Assigning Roles to MySQL Users — DatabaseJournal.com
http://www.databasejournal.com/features/mysql/assigning-roles-to-mysql-users.html

39. Installing WordPress « WordPress Codex
https://codex.wordpress.org/Installing_WordPress

40. Installing WordPress « WordPress Codex
https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install

41. WordPress › Download WordPress
https://wordpress.org/download/

42. http://localhost/wordpress/wp-admin/setup-config.php
http://localhost/wordpress/wp-admin/setup-config.php

43. Your PHP installation appears to be missing the MySQL extension which is required by WordPress. -Google

44. WordPress › Support » Your PHP installation appears to be missing the MySQL ...
https://wordpress.org/support/topic/your-php-installation-appears-to-be-missing-the-mysql-


I tried resolving the issue and researched it further, so the references are updated here:


References Part II- Updated Research That I tried to Resolve the Issue


3. Editing a Question - CodeProject
http://www.codeproject.com/script/Answers/Post.aspx?aid=1076355

4. http://localhost/wordpress/
http://localhost/wordpress/

5. Your PHP installation appears to be missing the MySQL extension which is required by WordPress. - Google Search

6. "Missing MySQL Extension" Errors with WordPress | Tiger Technologies Support
https://support.tigertech.net/wordpress-missing-mysql

7. Your PHP installation appears to be missing the MySQL extension which is required by WordPress | DigitalOcean
https://www.digitalocean.com/community/questions/your-php-installation-appears-to-be-missing-the-mysql-extension-which-is-required-by-wordpress

8. http://localhost/wordpress/
http://localhost/wordpress/

9. Index of file:///c:/Apache24/htdocs/
file:///c:/Apache24/htdocs/

10. php connect to database example - Google Search
https://www.google.co.il/search?q=php+connect+to+database+example&ie=utf-8&oe=utf-8&gws_rd=cr&ei=fk63VrSzKqjjywPB37PgDA

11. PHP Connect to MySQL
http://www.w3schools.com/php/php_mysql_connect.asp

12. set php config for mysqli - Google Search

13. PHP: Installation - Manual
http://php.net/manual/en/mysqli.installation.php

14. PHP: Runtime Configuration - Manual
http://php.net/manual/en/mysqli.configuration.php

15. http://localhost/testdatabase.php
http://localhost/testdatabase.php

16. Fatal error: Class 'mysqli' not found - Google Search

17. php - Fatal error: Class 'MySQLi' not found - Stack Overflow
http://stackoverflow.com/questions/666811/fatal-error-class-mysqli-not-found

18. PHP: Installation - Manual
http://php.net/manual/en/mysqli.installation.php

19. phpinfo()
http://localhost/test.php

20. mysqInd - Google Search

21. MySQL :: MySQL native driver for PHP - mysqlnd
https://dev.mysql.com/downloads/connector/php-mysqlnd/

22. mysqlnd example - Google Search
https://www.google.co.il/search?q=mysqlnd+example&ie=utf-8&oe=utf-8&gws_rd=cr&ei=z1S3Vo3lM8fCywPM-qXwDA

23. PHP: Quickstart and Examples - Manual
http://php.net/manual/en/mysqlnd-uh.quickstart.php

24. understanding phpinfo - Google Search
https://www.google.co.il/search?q=understanding+phpinfo&ie=utf-8&oe=utf-8&gws_rd=cr&ei=E1W3Vs37G4LYyAOyxpDYDQ

25. PHP: phpinfo - Manual
http://php.net/manual/en/function.phpinfo.php

26. PHP: get_loaded_extensions - Manual
http://php.net/manual/en/function.get-loaded-extensions.php

27. PHPmotion Wiki: What is a phpinfo() file
http://wiki.phpmotion.com/HelpPHPinfoFile


Reference - Full httpd.conf Apache Web Server configuration file (under Windows 7 Ultimate 64 bit) used to get WordPress to work

Quote:

#Intallation of the php mode per: https://wordpress.org/support/topic/missing-the-mysql-extension-1
#This LoadModule is not available
#LoadModule php5_module modules/libphp5.so
LoadModule php5_module "C:/PHP/php5apache2_4.dll"
PHPIniDir C:/PHP

#First option - only php files
#<filesmatch>
#SetHandler application/x-httpd-php
#

#Second option - php .php, .php2, .php3, .php4, .php5, .php6, and .phtml files to be executed as PHP
<filesmatch>
SetHandler application/x-httpd-php


#Third option - And to allow .phps files to be executed as PHP source files, add this:

<filesmatch>
SetHandler application/x-httpd-php-source
Posted
Updated 8-Feb-16 20:30pm
v6
Comments
StephenJElliott 7-Feb-16 4:28am    
My first step is to verify the MySQL installation directly from the command line; and then I would want to test it using perl since that is already installed in the cgi folder and I have verified perl is working.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900