====== Installing Joomla on my moleskin.ipowermysql.com 2007/01/02 ====== ===== The Problem ===== The software that I was trying to get to work together: * Windows XP * Apache 2.2.3 * PHP 5.2.0 * MYSQL 5.0.20a-nt * Joomla 6022 2006-12-18 22:30:07Z friesengeist * phpMyAdmin 2.9.1.1 The error message from the Joomla pre-installation check (install.php) was **"MySQL support unavailable."** ===== Sets of Solutions ===== I honestly don't know how many things I had wrong with my configuration. Some of my "fixes" may have caused me problems along the way. The things that worked to get phpMyAdmin running didn't solve all of the Joomla problems. ==== XAMPP: The road not taken ==== In retrospect, I can see that I could have solved all of my problems at one fell swoop by installing [[http://www.apachefriends.org/en/xampp.html|XAMPP]]. I console myself with the thought that I would have learned less about configuring my system if I'd done that. But I also would be about six or eight hours ahead of where I am now. P.S. When rebuilding my desktop recently, I decided to install [[http://www.wampserver.com/en/|WAMP]]. It's a smaller package than XAMPP and gave me all I needed to run Apache, PHP, and MySQL on my Windows XP desktop. --- // 2008/02/22 // ==== What does "MySQL support" mean? ==== **Overview:** * MySQL has to be installed: * as a service on the Apache server * with a username, password, and database intended to be used by Joomla. * PHP has to be configured to work with MySQL by: * selecting the MySQL extensions in PHP's setup; * modifying **php.ini**, a configuration file found in the PHP directory so that the extensions will be found and loaded. * Joomla has to be configured to work with MySQL by: * selecting the proper **database.php** file in Joomla's **includes** directory; * editing or generating the proper **configuration.php** file in Joomla's directory. === Installing MySQL with Apache === I downloaded MySQL and MySQL Administrator months ago to find out how they worked. I didn't understand what I was doing, but somehow or another I got this setup working: MySQL Server Information Connected to MySQL Server Instance Username: root Hostname: moleskin.ipowermysql.com Port: 3306 Server Information MySQL Version: MySQL 5.0.20a-nt via TCP/IP Network Name: moleskin.ipowermysql.com IP: 127.0.0.1 Client Information Version: MySQL Client Version 5.0.11 Network Name: IC-7577 IP: 138.xx.xx.xx Operating System: Windows XP Hardware: AMD Athlon(tm) XP 2000+, 512 MB RAM It seems to me that I had to let MySQL run as a service in order for Apache to find it and integrate it. I may also have had to tell Apache to look for MySQL and/or told it where it was. The Apache Monitor lists MySQL as a service that is running and reports this in the General tab of MySQL Properties: "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL Seeing MySQL running as a service in Apache gave me lots of hope that I could solve the other configuration problems. === Configuring PHP to work with MySQL === PHP is configured through **php.ini**, which is located in PHP's home directory (the directory to which I installed it). In my case, the file is **C:\Program Files\PHP\php.ini** . After hacking at this file for a long time without changing the feedback from the Joomla or phpMyAdmin installers, I realized that I could see what effect the changes in **php.ini** had by running **phpinfo.php** . This is a very simple file that I created with a text editor in the **htdocs** folder of my Apache setup. The full contents of the file are: **BIG DOH!** To see the effects of changes in **php.ini**, I had to make Apache restart after each change. **php.ini** is consulted by PHP only when the system starts up (DOH!) because it is an initialization file. You experts may all laugh at me now, but I'll bet you had to learn this the hard way, too, once upon a time. :-) OK, so with that discovery under my belt, I gained confidence that the changes I was making were having the desired effect because they all showed up somewhere in the output from **phpinfo.php** when I directed my browser to that file. In my system, that works out to the URL: http://moleskin.ipowermysql.com:8080/phpinfo.php (Don't ask me why I have to use '':8080'' to bring up my server. I don't know. Yet. I also don't remember how I stumbled across that workaround.) After a while, because of a clue found while googling, I saw that **phpinfo.php** was telling me about my MySQL installation, too:

mysqli

MysqlI Supportenabled
Client API library version 5.0.27
Client API header version 5.0.22
MYSQLI_SOCKET /tmp/mysql.sock

DirectiveLocal ValueMaster Value
mysqli.default_hostmoleskin.ipowermysql.commoleskin.ipowermysql.com
mysqli.default_port33063306
mysqli.default_pw******etrp2006
mysqli.default_socketno valueno value
mysqli.default_userrootroot
mysqli.max_linksUnlimitedUnlimited
mysqli.reconnectOffOff

In retrospect, I probably ought to have edited this line in **php.ini** from: display_errors = Off to: display_errors = On Alternatively, I could have watched the php errors by changing **php.ini** to have these lines: log_errors = On error_log = errors.txt Then I could have read **errors.txt** after each tweak to see what happened. I probably would have picked up more information that way about what was and wasn't working. Oh, well--next time! **The rest of the ''php.ini'' fixes:** This line tells PHP where to look for **.dll** modules (extensions) on my system: extension_dir =C:\Program Files\PHP\ext Some pages say that the filename needs to end with a "\". This line seems to be working OK on my system today, so I'm going to leave it alone. extension=php_mysqli.dll Because **phpinfo.php** was reporting that MySQLI support was enabled, I downloaded the **php_mysqli.dll** and placed it in ''C:\Program Files\PHP\ext'' . **ANOTHER BIG DOH!** //"Nemo dat quod non habet"//: No one can give what they don't have. I am ashamed of how long it took me to ask the question, "Do I have **phy_mysqli.dll** on my system?" I didn't have it anywhere on my computer when I started asking PHP to use it. I'll bet PHP would have been happy to tell me "file not found" if I'd been reading the +#$%&*! error messages. :-( One of the most helpful things I learned is that PHP can be reconfigured after installation by taking the following steps: * Start * Control Panel * Add or Remove Programs * (find PHP on the list of installed programs) * Change * Select extensions to be added and follow the prompts to finish. That produced a dramatic effect on the **php.ini** file. Suddenly, I had lots more information and more stuff to play with. Among the new lines I found these: ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ; at MYSQL_PORT. mysqli.default_port = 3306 ; Default host for mysql_connect() (doesn't apply in safe mode). mysqli.default_host = moleskin.ipowermysql.com ; Default user for mysql_connect() (doesn't apply in safe mode). mysqli.default_user = root ; Default password for mysqli_connect() (doesn't apply in safe mode). mysqli.default_pw = ****** I inserted ''root'' and filled in my password (indicated by the asterisks above). No harm in trying and I'm not going to go back and take them out to see what happens. This is a desktop server and security comes from keeping strangers away from my desktop. **In retrospect:** The day I installed PHP and configured it to work with Apache, I turned down the offer to install any extensions because I didn't know what an extension was. I didn't foresee that I would like to install MySQL later nor did I understand how much grief that decision would cost me later. Here again, folks who go the XAMPP route will be spared this particular learning curve. Ignorance isn't always bliss. === Configuring Joomla to work with MySQL === There really is no point to fiddling with the Joomla setup until PHP and MySQL are talking with each other. I didn't know that last night, so I alternated fussing with **php.ini** and **configuration.php** with unremarkably poor results. Getting [[http://www.phpmyadmin.net/home_page/index.php|phpMyAdmin]] to work made sure that the PHP/MySQL components were working together. It also gave me a method for creating a user, password, and database for Joomla to use, although I could just as easily have done that through [[http://www.mysql.com/products/tools/administrator/|MySQL Administrator]]. MySQL Administrator, however, does not interact with the database through PHP, so it wouldn't have confirmed that the setup was correct for future Joomla operations. Joomla needs to have the right set of database functions available to it so that it can contact the database, put stuff in it, and get stuff back out of it. The package is shipped with three database function sets in the **joomla\includes** directory: database.php database.mysql5.php database.mysqli.php To change from one set of functions to another, you have to rename **database.php** to something else, then rename one of the other two to **database.php** . It's like a game of three-card Monty: it's real easy to lose track of which version is hiding under the **database.php** label, especially for a clueless newbie like myself. It turns out that the one I needed was **database.mysqli.php**, but since I'd tried it several times with no luck (because I didn't have PHP and MySQL playing nicely), I got confused and discouraged. Even when I did manage to have PHP and MySQL working together, and even when I did have the right version of **database.php** installed, I still got the +#$%&*- error message, "MySQL support unavailable" with the Joomla installer. My first approach was to manually edit **configuration.php-dist** and save it as **configuration.php** . The error messages that came onscreen from that let me finally pick the proper **database.php** file for my setup (**database.mysqli.php**) and confirm that it was working--but I ended up with a totally blank installation with no templates. So I renamed my **configuration.php** to **configuration.php.sav** and started over with the installer. Still got the CONFOUNDED error message, but I ignored it and went on to the next few screens, filled in the joomla username, password, and database name that I had created, and finished the installation. **//IT WORKED!//** I figure the whole process took about seven hours.