session_start() error

Session functions, including session_start() should come first in an PHP page. It can not be preceded by any other thing, not HTML tags, not even a new line!

Moving wordpress blog to a different domain

Recently I moved my wordpress blog to a new domain. Many links broke. Styles were not applied. After googling, I stumbled upon this wisdom.

To update WordPress options with the new blog location, use the following SQL command:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
Browse through WordPress blog to check if everything is okay. You also need to re-login to WP Administration as authentication cookie has now became invalid due to different domain.

Changing the default storage engine in MySQL

I am reading this tutorial from Philip Greenspun. He uses Oracle. He uses reference constraint. One commenter said that you can do that in MySQL only if you use InnoDB storage engine.
The default storage engine in MySQL is MyISAM. If you want to change it, there are quite a numerous ways to do that.
You can change what storage engine to use for a table.
You can change what storage engine to use for a session.
You can change THE DEFAULT  storage engine so that whenever you create a new table, that default will be used.

To do the last, you need to edit the file /etc/mysql/my.cnf (in Ubuntu).
Under the [mysqld] add the following line as shown below!  
[mysqld] default-storage_engine = innodb 

And then restart the mysql:
sudo /etc/init.d/mysql restart

Uploading files from local linux machine to remote linux server.

So recently I become serious with learning web development. PHP and MySQL. I bought a shared hosting plan. Tinkered with it a bit. Got myself familiar with how it worked. Then I came across one problem. I needed a way to upload files from my Ubuntu machine to my hosting server which ran linux too. The GUI provided by the hosting company only acommodates 2 files to be transfered simultaneously. It would be too cumbersome to upload many files that way.
So I googled around and I found this website. It turned out that the command to do that is scp. I copy the command below:
scp file-to-send user@host:/path/to/place/file
Very easy. I also learnt something about ssh. To connect to my shared hosting using ssh, I would do the following:
ssh user@mydomain.com
And then I will be prompted for my password. Well, that's something new for me :D

Team -> Update is disabled/grayed out in Eclipse PDT

I recently installed Eclipse PDT (Eclipse package for PHP developer). Everything went well. It recognizes my existing Java project. Until today. I opened Eclipse, and when I right-click on a project to update it from SVN, the update menu is grayed out. Disabled. I didn't know what went wrong but I accidentally stumbled upon a simple fix. I deleted the project from the workbench (not from disk) and then re-opened it again. After being re-opened, the update menu is available again! My problem got solved but one question remained. What went wrong?

Enabling Ant, Searching for file containing certain text in Linux, Eclipse fails to run after crashing

I was importing project into Eclipse when I saw that there was no ant icon on .xml file. When I right click the build.xml, there was no option to run it as ant build. The solution is simple: just install Java EE Developer Tools Component.

I often need to search for files containing certain text in Linux. The following command does the magic:
grep -lir 'the text to be found' ./
I installed Eclipse PDT (Eclipse for PHP projects) and I tried to open a file with embedded applet. Eclipse crashed right away. After the crash, there was no way for me to start Eclipse again. After some searches, I stumbled upon this blog. I deleted the content of the .settings directory as explained in the blog, but Eclipse still failed to start. Then  Jason told me to remove user properties files. They could be found on the directory .metadata. This directory itself was located in the workspace directory. After I did that, Eclipse started, but I lost all of my workbench configurations and I had to redo all of the config. But it was better than not having Eclipse start at all. At least I learnt something new.

Firebug

I got the bugs nailed down. Firebug helped a lot in the process. I could never imagine how hard it would be without Firebug. If you are serious Javascript programmer, you should really learn to use this.
Two tabs which are most useful to me were the console and the script tabs. The console tab lets you see in real time the flow of the program. Which function/method is being called. What error message is output. Etc.
The script tag lets you define break point and inspect the value of the variables.