Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Monday, April 22, 2013

Wrestling with PHP, MySQL and Simple Machines Forum ...

Like a lot of busy folk, I've been looking forward for some time to the few days off work around the Easter / May Day holiday period (enhanced (in length at any rate) by Royal Shenanigans of course) to allow my poor old brain to cool down and to start functioning again.

So it was I returned to tackle a little problem I had set myself a few months ago, to install a Simple Machines Forum on my own web server, with the principle objective of using said forum as a tool to help our local Repeater Group operate.

I'm not an IT professional, but as I understand it, a Simple Machines Forum is some nifty code written largely in PHP, XHTML with some neat CSS, and which is in turn a "front end" to an SQL database.  I hope I've got that right, but that's how I've got it figured in my head at any rate.

Conventionally, people wanting to install SMF applications (which are free!) usually upload the said files to a web server provided elsewhere, and apart from tweaking the forum to look feel and operate like you want, that's more or less it.   Not that I am belittling such things, as they do take quite a bit of tweaking, it seems.

Of course this just isn't good enough here in the G4FUI shack, as I am running the repeater group web site in question on my own PC so the operation is a wee bit trickier.

You have to install PHP (free), MySQL (also free!),  configure Apache (the web server I use) to talk to PHP, and you have to configure PHP in turn to connect to the SQL service so that SMF can build a database and shuffle data in and out of it on demand.

It all sounds a bit geeky, doesn't it?   Well that is precisely how I found it.

Luckily there is a lot of helpful information out there on the web, and after a bit of "Googling" I found some advice which seemed to be pretty well aimed at my own requirements.    As a side note, whilst I was browsing through the various troubleshooting suggestions I couldn't help but notice the lack of hostility and aloofness which I have found on some of the equivalent Linux pages.   Maybe I'm imagining it?

The first serious attempt to get all this working was a month or so ago, and that ended in failure, so the project was "parked" until the Easter break.

The second attempt was much more successful.   Careful reading of the online advice revealed a little trick with a command line box.  This didn't produce a working system but it did produce an error message which was a bit of a giveaway "unable to find ..." followed by a file name which looked sort of  familiar.

The file in question had featured in one of the configuration files (php.ini) I had carefully edited a while ago, and if I'd only spelled the name of the file correctly my system would have been up and running a month or so ago!

D'oh!  Just one little letter makes such a big difference!
read more "Wrestling with PHP, MySQL and Simple Machines Forum ..."

Friday, May 6, 2011

Windows free for 30 days - Day 2

Day 2 of my Exam Revision Avoidance Strategy(tm)

I still haven't been to sleep yet, so this is still technically day 1, but whatever...

Linux & Gaming...
Tonight I decided to put some games on to play. Not the crappy card games that come with every OS, proper games, FPSes. I wanted to run Steam, and there's a this cool app called PlayOnLinux that handles all the fiddly bits for you. Basically you install it, and it handles all the Wine setup, etc, for you. Cool eh?

Installing POL was as easy as going to their website, adding their repository to my sources.list, and installing using apt. Installing Steam required even less effort - simply click on the "Add" button and select Steam from the list. Once Steam was installed, I shut it down, deleted the new steamapps folder, and created a symbolic link back to my normal steamapps folder. This saved me downloading the 6.9GB of games I'd already downloaded. Even cooler!

Running the games proved less fruitful. Source (the game engine) had a small brain hemorrhage (probably over my dual monitor, virtual space setup) and died a horrible horrible death. It's too late tonight to try again, but over the weekend I should get it sorted....


Linux Web Servers
If you've been exposed to Linux for more than 5 minutes you'll probably know they make the best web servers. There's even an acronym, LAMP, which stands for Linux, Apache, MySQL and PHP (WAMP is a Windows variant, but we don't care about that).

For the more nerdy among you, I've just spent the day recompiling php5 for Ubuntu to include GD2. This isn't normally included with the Ubuntu version of php5, and using apt to install it will not give you all the necessary image functions.

I've read a really good step-by-step on how to recompile php with the gd2 extension here.
read more "Windows free for 30 days - Day 2"