Tech Tips

Sharing PHP Code among domains on a shared hosting account with GoDaddy

Posted in PhP Stuff, Tech Tips on February 18th, 2009 by sway – Be the first to comment

Contrary to what the GoDaddy Technical Support team tells everyone… you CAN (yes, you can) share code between multiple domains on a shared hosting account with GoDaddy!!!

Basically, I am sharing with you my work around for fact that we’re not allowed to create symlinks in the sub folders (which hold the content of the other domains (secondary, non-primary domains)) of our unlimited shared hosting account.

You can complete this work around in 3 easy steps!

  1. In the root directory of your unlimited hosting account, create a php5.ini file which is a copy of the already given php.ini file
  2. Add this line to your php5.ini file:
    include_path = ".:/usr/local/php5/lib/php:/home/content/s/a/m/sample/html/shared_code"
  3. Place some code in your shared_code directory and you are done!

You will be able to access the classes and any scripts you have in that directory by including the file with no path. This means your includes will look like this:
include ("SharedClass.php");

(You can also change your fopen status in your php.ini file, but you can use cURL to work around any other fopen issues holding you up)

NOTE: This solution assumes that you are running a Linux server (not Windows) and are using PHP 5 (although this solution may work for PHP 4 on Linux if you make the changes to the php.ini file and not the php5.ini file)

Share/Save/Bookmark

How to get a Wordpress API Key for use with Plugins like Akismet

Posted in Tech Tips on February 18th, 2009 by sway – 2 Comments

Your Wordpress API key is a 12 digit (SECRET) code located in your user profile that allows you enable various blog related plugins through your wordpress blog.

In order to get a WordPress API key you first need an account at WordPress.com. If you have, or had a free WordPress blog hosted on WordPress.com, chances are you already have an API key.

First go to WordPress.com. and click ‘Sign Up’ in the top right side of the site as shown below. Please note that the login information for WordPress.com is completly different than that to login to your self-hosted WordPress blog!!!

After you sign up at WordPress.com you will receive an email with a link you need in order to activate your new account.  Once that is done, you have two methods of retrieving your API Key.  You can either:

1) wait for the account creation confirmation email which contains your account username and password as well as the text “Your WordPress.com API key allows you to use services like Akismet @ http://akismet.com/ API Key:” followed by a 12 digit alphaneumeric sequence which is your API Key

- or -

2) login to your newly created Wordpress.com account and find your API Key which is located at the top of your user profile screen following the text: “Your WordPress.com API key is: ”

(Access your user profile by clicking MyAccount > Global Dashboard and then clicking on either your username in the top right which will launch your user profile screen, or by selecting your user profile from the Users list in the menu.)

Share/Save/Bookmark