Is the green phlegm fairly thick?
Any blood in the phlegm?
Any fever above 101 degrees Fahrenheit or night sweats?
Saying "yes" to any of the questions indicates a need for doctor evaluation. This may be acute bronchitis (acute meaning of duration less than 6 weeks) or perhaps something more serious. Your physician may consider an inhaled bronchodilator (e.g., albuterol) or prescription strength cough suppressant if this cough prevents you from getting any rest. Antibiotics would be considered only if bacterial infection is suspected (90% of acute bronchitis cases are viral and do not require antibiotics).
Data reference: http://www.medicinenet.com/bronchitis/article.htm