The specific order of program installation does matter here.
PHP makes certain configuration changes to Apache's httpd.conf to enable support for PHP files.
If you install Apache after PHP, then those changes will not take place.
To add such support, either re-install PHP, or edit httpd.conf manually.
Chat with our AI personalities
It depends.
If your Linux distro supports packages like RPM, DEB or others, I suggest you to search the distro specific package and install it with the tool that the distro offers.
If you want to build it from source, or you don't have a package based distro do the following:
1) Download the package from the site php.net
2) From the terminal/bash console move into the folder where you downloaded the file
3) Decompress it, by typing: "tar -xvf nameofthefile.tar.gz"
4) Enter the folder you've just created by decompression "CD nameofthefile"
5) Do a configure procedure "./configure" to view configure options type "./configure --help"
6) Do a make procedure "make"
7) Finally a make install "make install"
8) Now you're ready, test your installation by type something like "php -v" and if you don't see errors all is fine.