IT Chat - News, tips, hints, ideas and freebies for people building websites or blogs

Fantastico, php and MySQL databases in cPanel

July 19th, 2008 Posted in Building my websites

Why Fantastico is fantastic

I’m going to declare my hand from the outset when it comes to Fantastico (more info about Fantastico) here.

Despite my best efforts, as a keen amateur building websites I have been unable to get to grips with the intricacies of manually installing Apache, MySQL and phpAdmin.

I’ve bought books, tried online courses, looked around the internet, but never succeeded in finding a source of information that manages to communicate the whole process clearly.

Believe me when I tell you that I’ve devoted a lot of fruitless hours to this quest - if you’ve found a brilliant source of information please tell me about it. and put me out of my misery.

I’m completely self-taught at php and MySQL, so read this knowing that I’m not an expert at this by any means … but I have found a way of being able to do cool things like an expert without having their knowledge.

That’s all due to Fantastico which takes the vile teccie stuff away from php and MySQL, so people like me - and possibly you - can get on with their lives without having to have in depth knowledge.

Strangely, I’ve learnt a lot doing it this way, much like I did getting to grips with algebra at secondary school.

At school, we used to have the answers at the back of the text book.

I used to start algebra homework with the answer and work backwards, and that way I suddenly got the hang of algebra … it just ‘clicked’.

That’s how it’s worked using Fantastico … Fantastico has given me the answer and I’ve learnt so much more about the entire MySQL/php/Apache business by working backwards.

I’m beginning to do the things I wanted to do when I started looking for in-depth courses, like creating standalone MySQL databases and linking these to standalone php installations.

So let me recommend it to you as a learning process for mere mortals … in my view, Fantastico really is fantastic.

What’s it all about?

Using Fantastico via cPanel basically means that the Apache server, MySQL creation and php installation is all taken care of on your behalf.

You just have to do some very simple configuration, the nasty bits are done for you.

It’s worth reading up to get a bit of background, but I’m sure you’ll soon realise like me that this is all a bit complicated when you do.

Apache: http://www.apache.org/

Apache explained on Wikipedia: http://en.wikipedia.org/wiki/Apache_HTTP_Server

MySQL: http://www.mysql.com/

MySQL explained on Wikipedia: http://en.wikipedia.org/wiki/MySQL

php: http://www.php.net/

php explained on Wikipedia: http://en.wikipedia.org/wiki/PHP

Fantastico gives you instant and easy access to an extensive range of brilliant php scripts which allow you to do incredible things with websites that you couldn’t do with basic HTML.

For instance in my website big-group-cottages.co.uk, I’ve extensively adapted a php database-driven website installation called Open Realty to create an extensive database-driven property website which I just could not have created on my own.

In my main business website webcumbria.co.uk I’ve used one of the many Content management systems available in Fantastico to make a complex, searchable website which is capable of growing to thousands of pages. Basic HTML just wouldn’t be up to the job.

So let’s get started and enable you on the path to MySQL/php and Apache enlightenment.

Installing Fantastico scripts

Fantastico iconLogin to cPanel and click on the Fantastico De Luxe icon.

You’re immediately taken to a long list of possible installations that you can use.

Hold your cursor over the titles and you’ll see what each installation can do.

Impressed yet? Look at all that web-making power at your fingertips!

I’ve dealt with many of these installations already in this blog, so check out a couple of previous posts to get to grips with my particular favourites:

Overview of my favourites: http://laptopmanpaul.co.uk/it_chat/archives/48

Open Realty: http://laptopmanpaul.co.uk/it_chat/archives/12 (Database driven websites)

phpList: http://laptopmanpaul.co.uk/it_chat/archives/3 (Newsletters)

CMS systems: http://laptopmanpaul.co.uk/it_chat/archives/26 (Big websites, easily done without HTML)

Mambo: http://laptopmanpaul.co.uk/it_chat/archives/17 (My favourite CMS syatem)

SMF: http://laptopmanpaul.co.uk/it_chat/archives/16 (My favourite system for creating forums)

Select which installation you want to try and click on the link.

It’s as easy to uninstall scripts as it is to install them, so I suggest you play freely, that’s what I did to learn my way around.

Install - play - uninstall if it’s not what you’re after.

You follow the same basic principles for each installation - below I’ve taken a screen grab for an installation of geeklog as an example:

geeklog installationNote the following things that you can do with each installation:

1) Go to the main homepage for the installation to find out what it does.

2) Take a look at the support forum. Learn to love your support forums, they’re a brilliant thing.

There’s never been a technical problem that I’ve had that I haven’t been able to get help with on a support forum.

3) New installation … click on the ‘New Installation’ link to start. When you have existing installations, they’ll all be listed below this line. I have many installations of SMF for instance, as you can see in the screen grab below. Notice how easy it is by the way to remove each

of the installations … you simply click the ‘Remove’ link.

Also note the (1.1.4) next to each installation. this just tells you which version you have installed. You’ll be asked on a regular basis to upgrade to updated versions and cPanel will guide you through this process.

You should always upgrade as this gives you the latest gizmos and - most importantly - security updates. 

When you create a new installation you’ll have to select which of your domains you want to install it on ie mybusiness.co.uk, myotherbusiness.com and so on. You’ll be asked to install in a directory as well.

Fantastico installationsI actually got this wrong in a couple of my websites and although no-one will die as a result of it, I should have done it differently in some cases.

If you are installing a content management system like Joomla or Mambo, the type of installation which you’ll use to run an entire website, you don’t need to install it in a directory. I didn’t need a directory for this blog either (it_chat is the directory) I could have just installed it directly onto laptopmanpaul.co.uk.

However, if you’re using a number of installations on one domain name, you will need to use directories or you’ll get in a terrible muddle.

Take webcumbria.co.uk as an example.

Mambo is the installation I use to run the basic website … I should have left the directory setting blank when I installed Mambo, but instead I called the directory ‘content_section’ … silly me!

However, any subsequent installations do need to be in a directory or you’re going to get into one big mess.

So for webcumbria.co.uk I have an SMF forum installation in the directory ’support_forum’ at http://webcumbria.co.uk/support_forum/ and a phpList installation in the directory ‘newsletters’ at http://webcumbria.co.uk/newsletters/.

Note that your directory title must be:

- all lower case

- no gaps, use an underscore (_) instead

- no symbols

Other information you have to enter as part of your new installation:

 - Administrator-username  … you need this to enter the protected admin area

- Password  … you need this to enter the protected admin area, make it a good one!

- Site name … just ‘mybusiness.co.uk’ or whatever your site is called

- Admin full name … Fred Bloggs or whatever it is

- Admin email .. the email address where you’d rather receive emails. Generally avoid personal email addresses, create a custom email address instead.

Click on the ‘install’ button and your installation will be made … just like that!

Once you’ve installed …

You’ll get an on screen confirmation that your installation has been successful, as well as links to a) you new website section b) the admin section of your new installation.

You’ll also be asked if you want to enter your email address to have the information emails to you … do it, you’ll thank yourself later for keeping this information to hand.

I’m not going to talk you beyond this point, as you’re now in the hands of the people who created the installation that you’re using.

Across the board, if you go to the homepage of each installation you’ll find ‘getting started’ instructions as well as FAQs and extras - like templates, themes and plugins - that you can bolt on.

If you’re still stuck, use the support forums.

Also, for much more detailed guidance, siteground.com has an excellent step-by-step guide to everything related to cPanel.

Enjoy experimenting and see which installations become your favourites.

A word about php

All the Fantactico installations use php, rather than HTML which is the coding system you’re probably more familiar with.

As you gain more confidence with php, you’ll find that you can alter certain sections to adapt them to your purposes, without having to have a great knowledge of php.

Note that you’re often advised not to fiddle with some bits of code in crucial sections of the installation and if you do fiddle, back up changed files as they may be overwritten when you upgrade to new versions in future.

I’m not going to get into php here and until you start getting into more advanced stuff, there’s not a lot of point clicking on icons in cPanel like ‘phpMyAdmin’ and the like.

MySQL databases … and one bit of advice you’ll thank me for

For every installation you create in Fantastico, a MySQL database is automatically created.

This is just where all the information for your website is kept.

Clearly if you lose this information you’re stuffed!

So here, I’m going to explain how to backup your databases.

If there’s one thing you remember for all time as a result of reading this post it’s to backup your MySQL databases.

Let me say that one more time … backup your MySQL databases!

You can retrieve all sorts of website horrors if you backup your databases.

Some installations have a built in backup system, but this covers all installations that you make via Fantastico.

To  get started with this vital task, click on the ‘Backup wizard’ icon.

Backup wizard icon

You can actually backup all sorts of bits and pieces via this icon, but I’m only going to focus on MySQL databases here, I’ll deal with other backups elsewhere in my cPanel guides.
When you click on this icon, you’ll be presented with the screen below.
You should just click on the word ‘Backup –>’ on the first screen , and on the second screen, in the column labelled ‘Select partial backup’ select ‘MySQL Databases –>’.

Backup wizard

You’ll be presented with a list of your MySQL databases.

I have so many of the things now, I keep a long list of which database belongs to which website, what each password is and so on.

I need a database for my databases!

To backup a database, click on it, and ’save as’ to your PC.

Put it somewhere safe … and make sure you have a backup regime in place on your PC or laptop so that if that keels over, you can still resurrect your MySQL databases easily.

If you don’t have an external hard drive available burn them to a CD … just don’t lose them!

Make backing up a regular routine. If you ever suffer a failure of IT systems or completely mess up a website (as I have done) you’ll be so pleased that you did.

More on MySQL 
MySQL database iconsTo get more familiar with your MySQL databases, click on the icon on the left hand side ‘MySQL Databases’ … remember, you won’t see any databases yet unless you’ve already installed some applications via Fantastico.

You can delete databases in this section and add new users … for now, and until you become more experienced, leave this alone.

The MySQL Database wizard is used for php installations which don’t come nicely packaged in Fantastico. Remember the comment I made about learning algebra by working back from the answers? Well, this is the tool I used to get to grips with MySQL databases.

One of my favourite CMS packages is E107 (find out more from this blog here) but it doesn’t come with Fantastico, so I had to make the installation on my own!

It’s simple … you create a database using the wizard, upload the files from E107 to your website, click on the ‘install’ link, follow the prompts and you’ve done it without (much) help.

See what I mean about learning backwards? It suddenly started making sense to me when I did this.

MySQL can even save you time

You can also import a database to make a website very swiftly without starting from scratch.

I use Mambo to make websites or other people, such as my property rental websites.

Here’s my basic template:

http://big-group-cottages.co.uk/my_holiday_cottage/

If a customer orders one of these websites, I create a new Mambo installation for them, import my templated database, then adapt it for their personal requirements, as in the example below:

http://www.the-granary-thurstonfield.co.uk/

It means that I’m not reinventing the wheel every time I make one of these sites and it also means I can offer these sites at an extremely competitive price.

See more cPanel posts on laptopmanpaul.co.uk

Managing your domain in cPanel

Back-ups, managing files and FTP accounts in cPanel

Managing email options in cPanel

Using cgiemail to send forms via cPanel

Hidden extras in cPanel

Post a Comment