today i will show you the command to make the installation of the apache server using the latest php. if you want to install apache on your server, the best way is to do it with yum, i have yum installed in my server, so i can do this with redhat or fedora with this command to install apache server:

install apache server
yum install httpd


install apache server with PHP
yum 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