To install under Windows/Apache/MyQSL you must change the contents of several files to accomodate Windows naming conventions. There are also a couple of minor bugfixes. Thus, this set of instructions only covers FreeMED Version 0.6.0. I got FreeMED running on a Windows 2000 computer running MySQL 3.23.55-nt, Apache 2.0.47 and PHP 4.3.2-Win32. These instructions are versions of the "TarBasedInstallation" instructions. As I run into more Windows bug fixes, I will amend this document.
Good luck!
Perhaps I will port it over in a pre-made zip one day, but for now this is it. Don't e-mail me or message me unless you wish to offer additions to this document (which you can do if you create an account here and log in, I think). Onward...
Step 1:
Follow the original TarBasedInstallation instructions for InstallThePrerequisites.
If you are running the same version of PHP as I did or later, you don't need to worry about Pear.
Step 2:
From the original instructions in InstallPhpWebToolsTar:
And now we start deviating from the instructions...
You need to grab "phpwebtools-0.4.0.tar.bz2" from the Source Forge page and a tool that can open a .bz2 file correctly, such as WinRAR (http://www.rarlab.com/). I tried to open the .bz and .bz2 versions with WinZIP, but could never extract them correctly. If you use WinRAR, go to the "File" menu and select "Open Archive" or hit CTRL+O. Find the file phpwebtools-0.4.0.tar.bz2 where you had previously saved it and open it. You will notice that it contains a file called "phpwebtools-0.4.0.tar". This is normal. Double click that file.
A new WinRAR window will open showing a directory named "phpwebtools-0.4.0". Now open Windows Explorer (NOT Internet Explorer!) and navigate to your PHP "includes" directory (such as "C:\php\includes"). Drag the folder from the WinRAR window into your PHP "includes" directory. You chould now have PHPWebTools installed in a directory such as "C:\php\includes\phpwebtools-0.4.0". We will now need to open the file "webtools.php" in that installation directory.
Navigate down to line 20 which reads:
We need to change the portion that says "/usr/share/phpwebtools/" to where our installation of PHPWebTools resides in a way that PHP will understand. Because PHP will not read just a single backslash ("\") in a Windows file name ("c:\php" will be misread as "c:hp" or some other such nonsense), we will need to use two backslashes for the directory name (like "C:\\php\\includes\\phpwebtools-0.4.0"). The final result should look something like:
That's it. PHPWebTools is installed, but keep the file "webtools.php" handy. We'll be cutting and pasting that directory name again later.
Step 3
This time, we'll be using the same begining from InstallFreeMedTar:
And we deviate at another directory name... Again, grab the .bz2 version ("freemed-0.6.0.tar.bz2") and open it in WinRAR. Just like the PHPWebTools file, "freemed-0.6.0.tar.bz2" will contain a file called "freemed-0.6.0.tar" which you must double click on. "freemed-0.6.0.tar" will contain the directory "freemed". In Windows Explorer, navigate to your Apache document root (such as "C:\Apache2\htdocs"). Drag the "freemed" directory from WinRAR into your Apache document root. You should end up with something like "C:\Apache2\htdocs\freemed". FreeMED is now installed.
Step 4
Back to the original Tar instructions. This time we follow CreateDatabaseAndConfigureConnection for just a second.
And another file difference. Those of you who have the hang of this by now may be feeling an urge to just go keep the previous steps in mind and follow the original TarBasedInstallation instructions, but you may want to read the rest of this anyway. It will save you some time.
We will need to edit our FreeMED settings file. It's located in the FreeMED "lib" directory (such as "C:\Apache2\htdocs\freemed\lib\settings.php". Navigate there with Windows Explorer and open the file with a text editor. Now back to our regularly scheduled instructions for a second...
So far, so good. We still need to change a couple of more things to get FreeMED to work under Windows though.
Go down to line number 10 which reads:
Change the portion that says "/usr/share/" to reflect the location of FreeMED. Don't forget to use the double backslashes for PHP, such as "C:\\Apache2\\htdocs\\freemed". Line 10 should now read something like:
Now create a directory to be used as the user data directory. This should be outside of your document root directory. I created the directory "C:\Apache2\user-freemed". Go back to the "settings.php" file and find line 74. It should read:
Change the portion that says "/home/nobody" to the name of the directory you just created and again remember the double backslashes such as "C:\\Apache2\\user-freemed". Line 74 should now read:
We're all done with "settings.php" now. Save it and close it. We still need to do a little more file editing though. Find and open your FreeMED "index.php" file with a text editor ("C:\Apache2\htdocs\freemed\index.php" for example). We will be changing lines 21 and 22 which currently read:
Remember the PHPWebTools directory way back in Step 3? We need that now. We need to change each instance of "/usr/share/webtools.php" to reflect our Windows PHPWebTools directory name such as "C:\\php\\includes\\phpwebtools-0.4.0\\webtools.php" (double backslash!). The lines should now look like:
We're done with "index.php" now. Save it and close it. We're moving on to "freemed.php" which can be found in your FreeMED "lib" directory (like "C:\Apache2\htdocs\freemed\lib\freemed.php". We need to edit line number 84 which reads:
Still have the location of the file "webtools.php" copied into the clipboard? Good. Just like the last file, we're replacing the part that says "/usr/share/webtools.php" with the location of our "webtools.php" file, such as "C:\\php\\includes\\phpwebtools-0.4.0\\webtools.php" resulting in something similar to:
Save "freemed.php" and close it. Smile a big smile. We're done. Go back to the other instructions and resume with ConfigureApache. Be sure to keep Windows file naming conventions in mind whenever you run into either the FreeMED installation directory or the PHPWebTools installation directory. Thus, the alias lines from the sample "freemed.conf" in the ConfigureApache instructions that read:
should read something like
BUT see the apache documentation for how to format the file name. Only PHP is taken into account for the instructions i have provided so far.
Notes and Bugs:
BUG: You may get a PHP error similar to "_() is not defined as a function" from a couple of files in FreeMED when you first run it after setup, like I did. Make note of which file and which line number the error came from and you will find something similar to line 36 of the file "custom_records.php" in your FreeMED install directory which reads:
You see that little bit that says "_($record_name)"? It's missing an underscore ("_") and should read "__($record_name)". Change it. This is how you fix the others too.