WordPress automatic upgrade not working and asking for FTP details

I run quite a few sites and on some of them I’ve installed WordPress for convenience. Every now and then a new version of WordPress is released and I like to keep my installation of WordPress up-to-date so that I’ve got the latest security patches and new features which have been developed. For earlier versions of WordPress (before 2.7), you had to do the install manually but with WordPress 2.7, you now have the option to upgrade automatically. As soon as a newer version is available, you have a link in the admin panel telling you to update your installation. You should be able to click on the update link and WordPress itself will download the latest files, extract them and update your WordPress accordingly. On one installation, it took no more than 15 seconds to complete the upgrade. However on my other hosting accounts, I’ve found that I just cannot update the software as it keeps asking me for my FTP details.

I know for a fact that the automatic upgrade should work but I wanted to give the FTP connection a go as well and it didn’t run as expected. WordPress couldn’t either extract some files or couldn’t create folders/files. I could have fixed the problem by giving write access to the required folder but I thought it was getting a bit too much as I don’t like the idea of putting my username/password for FTP in the first place. So I decided to find out a solution to the automatic upgrade problem instead and I spent hours researching the topic.

Here are the solutions that I tried:

  • define(‘FS_METHOD’, ‘direct’); in wp_config.php (didn’t work)
  • Give write permissions 777 to the whole wordpress directory for testing (didn’t work)
  • Editing file.php (found in wp_admin/includes) so that getmypid() is returned instead of getmyuid() (didn’t work)

If you’ve got full access to the server where wordpress is installed, you should be able to fix the problem easily but if you’re on shared hosting, things get complicated. My wordpress files/folders are owned by me on the hosting account but when a php script is executed, it runs as the nobody account. This is the default apache user that the server uses to run scripts on the shared hosting and that’s what is causing the headache. WordPress does a test to see if a file is owned by the current user executing the script and if that fails, it promts you for your FTP connection details.

I’ve looked into ways to overcome the problem but the shared hosting account doesn’t give me shell access, otherwise I would have been able to change the owner of the files/folders. If I get to run apache as my own user account, I should be able to get the wordpress automatic upgrade to succeed but I’m still looking for a solution at the moment. I’ve looked into php scripts executing commands (with exec) but I’ve still got to learn how to use that. If you’ve got the solution, then let me know.

How to migrate Microsoft Outlook from one computer to another?

After buying a new laptop, one of the things I had to do was migrating Microsoft Outlook 2007 from my old computer running Vista onto the new laptop running Windows 7. Now it is quite straighforward to copy the emails that you’ve received (or sent) to another PC but getting your email accounts to work on the new machine is a real killer.

If you have just one or two email accounts in MS Outlook 2007, then you can manually create the accounts once you have transferred your emails but if you have like a dozen email accounts, then it might be better to copy them from the old PC to the new one instead. To migrate your emails to another PC, all you have to do is create a backup of the emails. You do that by going into File -> Import & Export and choose ‘Export to a file’ and select “Personal Folder File (.pst)” and then choose the folder you wish to export. Usually it will be the Personal Folders and make sure you tick the box to include all subfolders as well. You might have to repeat this task if you want to copy your Archive Folders as well. Once you saved the .pst file on your old computer, you can then copy it to your new PC. You will have to copy it to the folder designated for Outlook files. It will be something like C:\Users\<your-user-name>\AppData\Local\Microsoft\Outlook\ (replace <your-user-name> with the name of the user that you use to log onto windows). Once this file has been copied there, you can then go back and click on File -> Data File Management (the Data Files tab should be selected now) and you can click on “Add” to add a new datafile to MS Outlook. You will need to select the .pst file that you just copied in outlook user directory. Do it for both the Personal Folders file and Archives one as well if you’ve copied it. Once this is complete, you’ll got all your emails on your new computer.

How do I copy all my Microsoft Outlook 2007 Email Account Settings from one computer to another?

With the above steps, your new computer will have all your emails but not the email account settings required to send/receive emails. If you do not want to enter each configuration (POP3 details, server name, usernames) one by one, then you will have to edit your registry file to do that. Note that passwords are not carried over, therefore you will have to enter the passwords for each account manually on the first send/receive emails and save them so that you do not have to enter them everytime. If you go to your old computer and launch Registry Editor (Start -> Run -> and type regedit.exe), you can then browse to the following:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Windows Messaging Subsystem\Profiles\Outlook

Right click on the folder and click on Export and save the file (.reg) somewhere on your old computer. Next transfer this file to your new computer and double click on it. This will launch warnings that you’re making changes to the registry, accept them. Note you may need to be logged on as an administrator on windows to perform this. Once this is done, you can launch Microsoft Outlook 2007 to see if it works – you may find that it doesn’t work and you find problems like cannot locate file to open or whatever other errors and this will be because the profile that has been created by the registry editor does not match the name. If that happens, go back to the old PC and look how the file is named there. My one was called DefaultProfile but when I copied it on the new laptop, it was named DefaultOutlook. You just need to rename it as DefaultProfile (same name as it appears on the old computer) and everything should work fine. Re-open outlook and it should work now. Remember that you will need to enter the passwords for all your email accounts when Outlook does its first send and receive emails and you have to check the box that says “save password…”.

For some strange reason, when that was completed for me, Microsoft Outlook had switched my Personal Folders file that I imported with a default one. You just need to re-select your default Personal Folders/Archive .pst files where you copied it on your new computer and you will have all your emails again. Make the Personal Folders file default now and remove the other ones.

I’ve tried to use Windows Easy Transfer to get MS Outlook migrated to my new laptop but it didn’t work. I spent so much time downloading Windows Easy Transfer for my Vista computer (although it did have one, I had to install a newer version), put the public key and selected which files I wanted to transfer (in this case only outlook files) but it didn’t do the job. Actually it just copied the email files and not the email account settings. As a matter of fact, your email account settings are stored in the registry, so you will have to use the above method to get Microsoft Outlook working on your new machine.

Google caffeine and indexed pages

Just before google caffeine was implemented, the number of indexed pages on my site were decreasing dramatically. I was starting to get worried because my traffic were decreasing consistently with the number of removed webpages in google index. However I did nothing and decided to wait and see what happens.

In January 2010, I noticed a significant increase in the amount of indexed pages for my website. The results were surprisingly high – I had 50%+ more pages indexed than before google caffeine. The number is increasing day by day probably because i update my website everyday but i’ve found that google caffeine seems to be giving more attention to crawling and indexing which is always a good thing.

If you have noticed a  decrease in the number of indexed pages on your website, then you need to look at the quality of the webpages of your site. My opinion on this is that if you have low quality webpages which is the result of an attempt to get updated content more frequently to entice GoogleBot, then maybe you need to change this. Nobody likes copied over content or little content with few keywords which are high paying. A webpage needs to serve its purpose and that purpose is to deliver on what it’s supposed to – for an article it needs to be rich in information, for a product, it needs to have a good description to clear off any doubts in the mind of the potential buyer.

SEOing your articles for the web

Writing articles to publish on your website should be done with great care. Below are a few recommendations to consider:

  • Use different variations of your keyphrases. By using punctuation, you can easily break phrases and since search engines don’t pay attention to punctuation, you can easily write “There is now a large choice for car insurance. London is where you will get the cheapest company…”. With this phrase you will be able to rank for “car insurance london”.
  • Have the right balance between pleasing your visitors and the search engines. Adding more keywords can give you better rankings in search engines but may put off users to your site because the article does not make much sense (keyword stuffed).
  • Keyword research is important but takes time. Including phrases which users are currently searching will most likely bring your article up the search engines for these phrases and others which are related to them.
  • Don’t force a group a keywords in your article if it doesn’t make sense. Eg “if you’re looking for mortgage quotes free, you’ll find them here”
  • Only use keyphrases that apply to the article. If you’re writing about horse shoes, then don’t try to include horse insurance because there are more searches for these search terms. Even you manage to rank high for horse insurance, when people come on your website, they will just leave when they see your article is nothing about horse insurance.
  • Use only correct spellings in your article. Misspellings should be avoided as well as slang.
  • ALT tags need to be used wisely for images in your article.

Top 5 things to build a successful website

By successful I mean a website that’s going to make money. From my experience, this comes down to 5 important points:

1. Pick up a niche (topic/subject/industry) where there are advertisers who are willing to spend money to market their products or services

2. Have a nice looking and simple layout for your website (first impression counts so make it look professional)

3. Write articles on topics which will attract visitors to your site – make the title catchy!

4. You need to have a good balance of keywords to triggers ads which are going to make you the money. So if you are writing an article on “How to cope with mortgage repayments?”, then you don’t want ads targetting new mortgages to appear but rather ads on mortgage problems so that the visitors are more inclined to click on the ads.

5. SEO and marketing – on page seo is easy to tackle and off page seo should be done with only quality links rather than going for bulk innefficient links. Marketing should be an ongoing process to get more exposure for your site and articles.