Thursday, 14 November 2013

Installing MediaWiki on Windows Web Server 2008 and IIS7 or so

I notice that I have documented how to install PEAR onto MediaWiki here: How to install PEAR Mail Package onto MediaWiki.

However I never documented the steps I took to get MediaWiki up and running in the first place, and mostly for my own benefit (in case I have to do it again) I am thinking I should do that.

Let me see if I can remember the steps I took and the instruction pages I followed (however loosely).

(1) Probably I started by installing PHP either from here:
php downloads
Note: "If you are using PHP with IIS you should use the Non-Thread Safe (NTS) versions of PHP."

or by using the Microsoft Web Platform Installer:
Microsoft Web Platform Installer


(2) Curiously enough, it looks like from my web history, that I then installed the IIS "Administration Pack" from here:
IIS 7.0 "Administration Pack"

I notice in particular that this supports "FastCGI" which I do have installed on my IIS box - and presumably this is how it got there.
And I think this has something to do with how PHP integrates with IIS.



(3) MySQL
I looked at this: Best MYSQL Client, but I'm pretty sure I did not infact install any MySQL clients... Just the server... How did I install the MySQL server? Maybe it was already on the box?




I am still editing up this post!


Thursday, 7 November 2013

Pear Mail Package is not installed

Circumstances:
Windows 2008 Server Web
IIS 7 ish
PHP
Mediawiki

Innocent looking message, isn't it! :-S
Probably you have installed PHP and MediaWiki, and no one thought to mention that if you configured your email service settings with something like:

$wgSMTP = array(
'host' => "smtp.my.com", // could also be an IP address. Where the SMTP server is located
'IDHost' => "mywiki.my.com", // Generally this will be the domain name of your website
'port' => 25, // Port to use when connecting to the SMTP server
'auth' => true, // Should we use SMTP authentication (true or false)
'username' => "myaccount@my.com", // Username to use for SMTP authentication (if being used)
'password' => "mypassword" // Password to use for SMTP authentication (if being used)
);

... that if you did that in your "LocalSettings.php" of your mediawiki,
then you would need to install PEAR and PEAR mail package and PEAR Net_SMTP package.

I have heard it said that you can avoid all of the following hassle, by setting $wgSMTP = false;
but for this to work you need to have a local mail server configured on localhost.
I have no idea if any of that is true (cos in our case we don't, and don't want to), but just mentioning in case you do.


Through lack of documentation, 100s of red herrings, stuff that doesn't do what the documentation says it does, and etc, it took me a day to figure this out.

So having figured it out, I thought I would share:

(1) If you don't have PEAR installed (and quite probably you don't), you have to install PEAR via either:
go-pear.phar
go-pear.bat
go-pear.php

In the end the one I got to work was the go-pear.phar
Review various lists of instructions on how to get these to work.
I used these:
http://www.xenoinc.org/blog/install-pear-on-windows
http://www.hermeswritings.com/index.php/2013/05/install-pear-with-wamp-2-2/
http://blog.pear.php.net/2009/07/01/php-53-windows-and-pear/
http://pheli0x.wordpress.com/tag/missing-go-pear-bat/
http://www.sitepoint.com/forums/showthread.php?565850-Installing-PEAR-on-Windows
http://blog.pear.php.net/2009/07/01/php-53-windows-and-pear/
http://stackoverflow.com/questions/3109633/installing-pear-iis-problem
http://www.sitepoint.com/forums/showthread.php?540009-PEAR-Problem
This last one is not very helpful, but I thought I should include it for completeness:
http://pear.php.net/manual/en/installation.php

Theoretically go-pear.phar or go-pear.bat is waiting for you to run it in your PHP installation directory.
But in practice, it very often isn't.
So you need to get it from the following places:
(a) go-pear.bat is here:
[[[I lost the link for this... sorry]]]
I found this route had problems creating directories at one point, presumably a permissions issue, or maybe something had locks on files, I don't know.
It might be necessary to stop your web server or something to get it to work... again, I don't know, just guessing out loud.

(b) go-pear.phar is here:
http://pear.php.net/go-pear.phar
You are supposed to put this in your PHP installation folder and run if from the command prompt, something like this:
command prompt-> php go-pear.phar
Then follow the instructions as per the links above.

(c) go-pear.php is here:
http://pear.php.net/go-pear.php
Apparently you should put it a folder under your web domain, and run it via the browser.
Be careful it doesn't over-write an alternative index.php that you already have in the target folder (which it did in my case before I gave up on trying to get this route to work).
You can also run it from the command prompt. There are instructions inside the file on how to do that.


In order to get go-pear.phar to work I had to install a different version of PHP and switch my MediaWiki over to using it.
This turned out to be surprisingly easy, once I had given up resisting doing it. (See note 3(b) below.)
The version I had (5.4.20) just didn't want to know.
Whenever I ran:
command prompt-> php go-pear.phar
... nothing happened at all.
No error messages, nothing. Just returned a blank line to the command window and then returned to the commmand prompt.
Using:
command prompt-> php -d phar.require_hash=0 go-pear.phar
instead of plain:
command prompt-> php go-pear.phar
made no difference (in my case)

Once I had 5.4.14 installed the go-pear.phar just worked. In the same way as with 5.4.20 it just didn't work.
(I installed this via the Windows Web Platform installer to its default path: c:\Program Files (x86)\PHP\v5.4\ )
(Google: Web Platform Installer)

Or PHP downloads are here:http://php.net/downloads.php

(2) Nobody tells you the obvious, probably cos they just assume you know.

Once you have got Pear installed, you need to install BOTH (A) the Pear Mail package:
for example:
command prompt-> pear install Mail-1.2.0
See: http://pear.php.net/package/Mail/download/

AND!!! (B)
some dependency package, no idea what it is, but it is needed:

command prompt-> pear install Net_SMTP
Otherwise you will get:
Class 'Net_SMTP' not found in smtp.php on line 349


(3) Other hints and tips:

(a) http://www.mediawiki.org/wiki/Manual:How_to_debug

To turn on PHP error reporting in MediWiki, add:
error_reporting( -1 );
ini_set( 'display_errors', 1 );
to your LocalSettings.php

(b) To manage which version of PHP that IIS is using in what respect,
go the the root of the web server in IIS manager and choose either the icon for
"PHP Manager" or "FastCGI Settings".
That I have both of these might be a consequence of how I orginally set up PHP way back when.
I don't know why there needs to be two icons, but I don't think it matters too much as long as you are aware you may need to modify settings in both of them.

(c) To check or set missing environment variables such as PATH or the various PEAR environment variables on Windows,
go to: Control Panel -> All Control Panel Items -> System -> Advanced system settings -> Advanced (tab) -> Environment Variables (command button)

(d) Add or remove
$wgShowExceptionDetails = true;
line from LocalSettings.php

(e) Other links:
http://www.mediawiki.org/wiki/Manual:Installing_MediaWiki_on_Windows_Server_2008
http://www.php.net/releases/
http://pear.php.net/
http://pear.php.net/manual/en/installation.checking.php

Friday, 14 June 2013

Sunday, 24 August 2008

How do I clear my cache?



Dear UK Software consultant,
I have heard people say that it is possible to clear out temporary internet files that my browser is "caching".
How do I do this?



In IE7 go to “Tools” in the top-right corner and select the first option “Delete Browsing History”.
Click the first button at the top which says “Delete files” …
DON’T CLICK ANY OF THE OTHERS!

Sunday, 27 January 2008

Paying too much for software developments?

I found out this week, that one of companies that act as a kind of middle-man between me and a client, on a software project I am the lead developer on, is charging me out at 5 times the daily rate they are paying to me. 3 times as much I think is typical, and I have often wondered about quite what this differential is, and speculated about how high it might actually get.

If you are a customer, and it seems to you that you are paying more than you might expect for the delivery of a software project, this might give you a clue about why.

The moral of story (I'm hoping) is obvious: come to me direct!

Sunday, 21 October 2007

Tailored database software

Tailored, as contrasted with bespoke, database software, built against industry standard backend database servers such as Microsoft SQL server, MySQL and Oracle. (Or even Microsoft Access)

Wednesday, 1 August 2007

Transfer of an AS3 flash class which imports fl.controls.*; (compiles fine in CS3) into a flex project

I am trying to do some straight forward transfer of an AS3 flash class (which compiles and works fine in CS3) into a flex project.
I created a new AS3 class in my flex project and then transferred the AS3 code out of my flash AS3 (.as) file into this class.
Then I tried to compile it.
I discovered I was missing the fl. libraries, so...

I made a reference to the fl folder on my c drive (under C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\User Interface\fl) , and the fl. start showing up in the intelisense in Flex as I expected.
Eg. at the top of the class I import:
import fl.controls.*;
import fl.events.SliderEvent;

But when I come to compile the AS3 class which compiles fine in Flash, I am getting compile errors like: “1046: Type was not found or was not a compile-time constant: SliderEvent”.

Anyone know a foolproof way how I take a working Flash .as class, and compile it in Flex? (I mean one that makes use of some of these fl. libraries.)