Login to your SSH into your server and execute the following command at the shell prompt:
Code:apt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
This will all the required files to successfuly install your Apache Server automatically.
Hope this helps