WP Tutorial: Faking out Fantastico

Posted by Danalyn

WordPress released version 2.1 earlier this week.  Keeping up with software upgrades can become tedious.  However, in this day and age of malicious intent, upgrading has become a necessary evil.

As a host, WDS usually recommends clients use Fantastico to install their blogs, as it offers 1-click installation and upgrades of over 50 scripts, including WP.  The beauty?  You don’t need to know how to install anything!

Unfortunately, if you've ever installed WP manually (or had someone do it for you), you'd know that by default, Fantastico will not know how to upgrade your installation.

Luckily, this can be rectified just by uploading a few files to your server.

Warning: I have only tested this with an upgrade from 2.0 to 2.1. I imagine it will work just fine with 1.5 to 2.0, but I am not 100% sure of this!

The .fantasticodata directory

If your host provides Fantastico, you should have a directory on your server (in the FTP root - this is where you find your public_html directory, not within public_html) that stores Fantastico data files. This directory is conveniently called .fantasticodata (note the "." before the name).

If your WP installation is located in your document root directory (i.e. public_html), then continue. If your WP is installed in a subdirectory (i.e. /blog), skip to the next step.

1) installed_in_root.php - Open up a text editor (do not use a rich text editor, or you'll have problems), and paste the following code into it, change yourdomain.com to your domain:

<?
$installed_in_root["yourdomain.com"] = 1;
?>

Save the file as installed_in_root.php, and upload it to the .fantasticodata directory on your server. Make sure you have NO spaces and/or line breaks before the opening <?php tag, and no spaces or line breaks after the closing ?> tag.

2) WordPress (directory) - create a directory within the .fantasticodata directory called WordPress. Use upper and lowercase letters.

3) yourdomain.com| - create a new file in your text editor, and add the following code. Change your_db_name to the database name your current WP installation is using (if you do not know, check the config.php file in your WP install), change yourdomain.com to your domain, change /home/your_username/public_html to the actual server path of your WP install (leave off the trailing slash).

<?
$thisdb = "your_db_name"; $thisdomain = "yourdomain.com"; $thisscriptpath = "/home/your_username/public_html"; 
?>

Save the file as yourdomain.com|, change yourdomain.com to your domain. Note the "|" at the end of the file name.

If your installation is located in a subdirectory, save the file as yourdomain.com|subdirectory, where yourdomain.com is your domain, and subdirectory is the subdirectory your blog is installed in.

Upload the yourdomain.com| file to the WordPress directory (the one you just created in .fantasticodata, in step 2).

** If your Windows computer won't let you save the file with the "|" at the end, rename the file after you upload it to your server.

The installation directory

4) fantversion.php - create a new file in your text editor, copy and paste the following code, change the version number (2.1) to your current WP version (version number is shown on the bottom of your WP Admin page):

<?php
$version = '2.1' ;
?>

Save the file as fantversion.php, and upload it to your installation directory (i.e. public_html).

5) fantastico_fileslist.txt - create a new file in your text editor, copy and paste the following (no changes necessary):

wp-admin
wp-content
wp-includes
data.sql
fantversion.php
index.php
license.txt
readme.html
wp-atom.php
wp-blog-header.php
wp-comments-post.php
wp-commentsrss2.php
wp-config-sample.php
wp-config.php
wp-cron.php
wp-feed.php
wp-links-opml.php
wp-login.php
wp-mail.php
wp-pass.php
wp-rdf.php
wp-register.php
wp-rss.php
wp-rss2.php
wp-settings.php
wp-trackback.php
xmlrpc.php

Save the file as fantastico_fileslist.txt and upload it to your installation directory (i.e. public_html)

The End

That's it! Now, you should be able to log into your cPanel and view your installation under Fantastico. Upgrade and uninstall via Fantastico from now on!

And...If you absolutely must know what these files do...

  • installed_in_root.php - tells fantastico whether or not you have any scripts installed in your document root, if so, don't allow any more
  • yourdomain.com| - stores the database, domain, and file location information for future upgrades/uninstall
  • fantversion.php - tells Fantastico which version you currently have installed
  • fantastico_fileslist.txt - tells Fantastico which files/directories to remove if you uninstall
Posted on: 01.25.2007
Posted in: Shitty Code