I have recently been trying to install PHP and Apache on my computer. After many hours, they\'re installed. I have modified the httpd.conf and php.ini files like everyone sa
In my case with PHP7.3 Apache2.4 Ubuntu 18.04 I had to execute:
$ a2enmod actions fastcgi alias proxy_fcgi
if the module userdir is enabled and your site is in a userdir (~/public_html) you must check /etc/apache2/mods-enabled/php5.conf. The following part makes it work (on Ubuntu 14.10 utopic):
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
# <IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_flag engine Off
# </Directory>
# </IfModule>
Wow, lots of solutions here! Here's what I did on Ubuntu 16.04:
sudo apt-get install php libapache2-mod-php
sudo a2enmod mpm_prefork && sudo a2enmod php7.0
sudo service apache2 restart
A different answer that worked for me. Is that, to install [sudo] apt-get install libapache2-mod-php5.X
none of the above applied or worked for me... PHP7, Apache Httpd 2.2 on CentOS 6
fact is, I installed (all with yum) php BEFORE Apache... you must do the reverse: always install Apache first, then PHP, and then it works...
Indeed, you are likely missing libphp7.so
and libphp7-zts.so
in /etc/httpd/modules/
I was able to recover anyhow without UNinstalling PHP. I did add the magic line in /etc/httpd/conf/httpd.conf
: AddType application/x-httpd-php .php
And then run: yum install php php-mysql
open the file
/etc/apache2/httpd.conf
and change
#LoadModule php5_module libexec/apache2/libphp5.so
into
LoadModule php5_module libexec/apache2/libphp5.so
So just uncoment the PHP module load in httpd.conf