Wiki's and php
Just spend the last few days working on Media Wiki. Version 1.5 has just been released, and so I thought I'd give it another go. Being an IIS/Windows man the first attempts I had ended in abject failure, after lots of head scratching.
This time I hit it a little harder. First up was PHP 5.
To get this working is relatively straight forward, install it then (bizarrely) copy across all the missing files out of the complete package zip. Why they couldn't just ship it all in one package is beyond me. Why also they couldn't have made it default to Isapi I don't know either. So next up it was fixing the association with PHP. This is done using the IIS manager, down lots of dialogs.
Next up its important (if using 2003 server) to fix the file permissions. The default permissions given to every file on a 2003 server seem daft. The creator owner has no access to anything. I presume this is to stop script kiddies, but since it extends to the Inetpub folder, you have to break the permission inheritance and then correct the problem.
Beware: Do not fall in to the trap of copying files into that folder and assuming everything will be ok. Explorer files copies copying the permissions as well. Upshot: everything turns up with borked permissions.
So back to PHP. PHP is mostly done, except the Mysql drivers. First hack the php.ini to enable the mysql extension - just an uncomment. Then (the most important bit). copy libmysql from the php folder to somewhere in the path - I chose window\system32.
I have a whole seperate rant about paths - these days the whole concept seems to be so broken, as every window or batch file has a master set that seem impossible to change (certainly few people seem to know how to do it in their setups).
PHP is now ready to go! I use V5 - it was the first to work for me, and new is better, right?
Note: older versions of PHP include an old version of the mysql driver causing lots of "Incorrect client" errors. 5 seems to be fine though.
Next up MySql. Oh. Newer isn't better. Don't try MySQL 5, media wiki is not quite ready for it yet. Instead do a clean 4.15 install. Make sure you remember all the passwords!
Finally its time to unpack media wiki to a folder on the webserver (remember the permissions!!). If you have done all that right it should configure itself off the bat. If you have a working SMTP service it can be turned on in LocalSettings.php.
Tada! Working media wiki - ready to fill.
I then installed phpmyadmin so I could take a nose around the db.
Its a remarkably simple structure. I'm not too familiar with PHP, so I thought I'd give that a little look too. After finding a trial of a PHP debugger I stepped through the mediawiki code.
Wow. What a lot of stuff it does on a single page!! No wonder its a) slow and b) everyone wants to install php acceleration.
Don't get me wrong, the code is clean and simple, but the amount of processing it does surprised me - like loading the localsettings.php on every page. I just expected it to do much less. Everything goes thru index.php and then spawns out into upto 30 files.
Still it all works, and its features are good. Now I'm on to making a few customizations. The extensions framework seems to be pretty complete, so I'm off to write some. Name value pairs in the DB and templated entry seem like good starting points.
Check back to see how I get on!
This time I hit it a little harder. First up was PHP 5.
To get this working is relatively straight forward, install it then (bizarrely) copy across all the missing files out of the complete package zip. Why they couldn't just ship it all in one package is beyond me. Why also they couldn't have made it default to Isapi I don't know either. So next up it was fixing the association with PHP. This is done using the IIS manager, down lots of dialogs.
Next up its important (if using 2003 server) to fix the file permissions. The default permissions given to every file on a 2003 server seem daft. The creator owner has no access to anything. I presume this is to stop script kiddies, but since it extends to the Inetpub folder, you have to break the permission inheritance and then correct the problem.
Beware: Do not fall in to the trap of copying files into that folder and assuming everything will be ok. Explorer files copies copying the permissions as well. Upshot: everything turns up with borked permissions.
So back to PHP. PHP is mostly done, except the Mysql drivers. First hack the php.ini to enable the mysql extension - just an uncomment. Then (the most important bit). copy libmysql from the php folder to somewhere in the path - I chose window\system32.
I have a whole seperate rant about paths - these days the whole concept seems to be so broken, as every window or batch file has a master set that seem impossible to change (certainly few people seem to know how to do it in their setups).
PHP is now ready to go! I use V5 - it was the first to work for me, and new is better, right?
Note: older versions of PHP include an old version of the mysql driver causing lots of "Incorrect client" errors. 5 seems to be fine though.
Next up MySql. Oh. Newer isn't better. Don't try MySQL 5, media wiki is not quite ready for it yet. Instead do a clean 4.15 install. Make sure you remember all the passwords!
Finally its time to unpack media wiki to a folder on the webserver (remember the permissions!!). If you have done all that right it should configure itself off the bat. If you have a working SMTP service it can be turned on in LocalSettings.php.
Tada! Working media wiki - ready to fill.
I then installed phpmyadmin so I could take a nose around the db.
Its a remarkably simple structure. I'm not too familiar with PHP, so I thought I'd give that a little look too. After finding a trial of a PHP debugger I stepped through the mediawiki code.
Wow. What a lot of stuff it does on a single page!! No wonder its a) slow and b) everyone wants to install php acceleration.
Don't get me wrong, the code is clean and simple, but the amount of processing it does surprised me - like loading the localsettings.php on every page. I just expected it to do much less. Everything goes thru index.php and then spawns out into upto 30 files.
Still it all works, and its features are good. Now I'm on to making a few customizations. The extensions framework seems to be pretty complete, so I'm off to write some. Name value pairs in the DB and templated entry seem like good starting points.
Check back to see how I get on!
Comments