Thursday 7 August 2008

Getting my website to work

I decided to spend this morning trying to get my website to work on my webhost.

The trouble I was having was that on the server it was giving an error message that it couldn't find the php includes files. I thought the problem was that my webhost had setup their system so the site root refered to when doing a php include was below the documentRoot, wheras on my local setup the root refered to when doing a php include was the documentRoot. After doing lots of reading on virtual hosts and raising a ticket with my webhost I finally managed to fix it.

The problem was nothing to do with the root at all - in fact my php includes were relative, not relative from the root i.e. they didn't start with a forward slash /, which I thought I had done. The problem was that my local environment is windows, which is case insensitive, while the server runs on Linux, which is case sensitive. Some of my includes files I had refered to like include('SSI/Nav.inc.php') wheras the actual file was named nav.inc.php, so it didn't work.

After fixing that on my index page, I found the navigation menu didn't work. After doing some work on this, I found that I had to change some stuff in the SQL query to get it to work. An IF statment IF field IS TRUE I had to change to IF field = 1. Not sure why, although the web server is running mysql 4.1 wheras I'm running 5.something locally. Also had problems with my query referring to tables with the wrong case, again because Linux is case sensitive while Windows is not. More info on that in the MySQL manual.

In the afternoon I did a bit more work on the website, then did a bit of Japanese learning. Did some gardening to dig up some ground near the pond so we can plant wild flowers there and also plant some buddleia in the garden to encourage butterflies.

After dinner I watched the DJ Yoda goes to the movies video with Mac. Then I sorted some macro pics I took today. Watched a bit of PeeWees big adventure with Mac and Ben and listened to old American folk music.

Food
Breakfast: Almond Oats & More cereal; cup o' tea.
Before lunch snack: 2 x fried chicken pieces (that Ben made using the cooking guide recipe)
Lunch: Cheese on toast; clementine; banana; Fox's whipped cream (same as viennese whirl); cup o' tea.
Dinner: 4 x fried chicken pieces (that Ben made using the cooking guide recipe); potatoes; mini corn on the cobs; green beans. Pudding was Cornish ice cream with Scottish raspberries. Coffee. Roses.
Supper ten crupper: Choco Liebniz biscuit; cup o' tea.

No comments: