How can I throw other ideas from my mind while doing PhD?
It sounds as though you are having a hard time finding motivation for pursuing your PhD. You don't mention the focus of your research, but one idea would be to modify the focus so that it aligns better with your addicting hobby of web-development (I'm not familiar with CS, so I have no idea how this would work in actual practice. Others will better be able to advise you on that.)

Become interested in your research. Assuming that you have compelling reasons for staying in your current area of research, you will need to have a genuine passion for the subject, or completing the PhD will become well-nigh impossible due to lack of motivation. See this article by Scott Young on how to learn boring subjects; his advice also holds for renewing interest in something. See the key points below.


Don't pick degree programs you hate. Although there are times when you may have to take courses you don't actually like, avoid a career made up of tasks and information you hate.
Don't confuse boring and difficult. It is easy to avoid something as boring, rather than admitting that it is difficult. 
Find the 'real-world' connections. Math isn't boring when you begin to see the connections and overall patterns--ditto for many other subjects/areas.
Discover the context. Take the time to explore the background, and understand why these [proofs, theorems, whatever] are important for where we are now. Young recommends reading Wikipedia articles on lunch-breaks for this purpose.
Make stories and pictures. Learning is a creative activity--the product is the intangible connections and stories in our minds. Mnemonics and stories can be interesting even when the subject is not. (Use this for the necessary but boring parts of research.)
Use the knowledge. Using even part of what you learn in a separate project will help cement the learning, and will also be interesting. (And anyway, isn't this part of the purpose of a PhD, to apply knowledge in new ways?)
Realize that not everything will be fun--more interest is better, even if relative differences still exist.