if You have higher version of php-common or any thing then first remove it and after that install php5-curl , php5-gd, and what-ever you get error. some thing like this... but you have to notice that when you are trying to remove module then that time some other module is when i try to run sudo apt-get remove php5-common then i get Removing php5 ... Removing libapache2-mod-php5 ... Module php5 disabled. To activate the new configuration, you need to run: service apache2 restart Removing php5-cgi ... Removingl php5-mysq ... Removing php5-mcrypt ... Removing php5-cli ... Removing php5-common ...aloso removed some thing like then you have to install all removed module like sudo apt-get install libapache2-mod-php5 sudo apt-get install php5-cgi sudo apt-get install php5-mysq sudo apt-get install php5-mysq sudo apt-get install php5-cli sudo apt-get remove php5-common sudo apt-get install php5-curl