How to configure Apache 2 to run PHP 7.0
I used this link to reinstall php on ubuntu and all the required php modules.
http://tecadmin.net/install-php-7-0-apache-2-4-mysql-5-6-on-ubuntu/
But to help you, try these -
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.0-fpm
service apache2 reload
Last one is just to restart apache server.
Related videos on Youtube
Shivam Aggarwal
Updated on September 18, 2022Comments
-
Shivam Aggarwal over 1 year
I've installed both Apache2 and PHP7.0 on my Ubuntu 14.04 and on running
localhost
I get a Apache welcome page but placing ainfo.php
file inside/var/www/html/
doesn't give me any specific page but instead gives me raw php code.
I'm new to this and I've searched alot but couldn't find any suitable resource as all of them use php5 instead of php 7.
They talk about editing configuration files but I don't understand which files they are really talking about.
Plus there is no mention as to why are such changes made to the files.
I would be very helpful if someone could please help me out with instructions on the same along with explanations.
Thank you.
P.S. I have two php in my/etc/
folder,php5
andphp7.0
. Which one should I use? And should I purge the other one?-
oerdnj almost 8 yearsWhat does "installed both Apache2 and PHP7.0" mean? How did you installed it?
-
Shivam Aggarwal almost 8 years@oerdnj I'd installed both of them apt-get but removed it afterwards only to manually install them from source, but now I cannot link them together.
-
oerdnj almost 8 yearsI would recommend using a clean system if you don't exactly know what you did in the past.
-
Shivam Aggarwal almost 8 yearsI'd removed all pre-existing files and did a fresh install, but couldn't make out how to link them together.
-
oerdnj almost 8 yearsThen you need to describe the exact commands you have used to compile and install apache2 and PHP
-