Reputation: 675
I can find the php5 mod in the mods-available directory, but I'm not sure how to get it into the mods-enabled directory.
Also, I just wanted to check that this is the way to enable php on my device...I know that PHP is installed, but another dev has disabled it (and is uncontactable)!
Upvotes: 54
Views: 250418
Reputation: 81
apt-get install libapache2-mod-phpX.X
sudo a2enmod phpx.x
sudo a2dismod xxx
sudo service apache2 reload
/etc/apache2
, you might find something you needUpvotes: 5
Reputation: 13344
You can use a2enmod
or a2dismod
to enable/disable modules by name.
From terminal, run: sudo a2enmod php5
to enable PHP5 (or some other module), then sudo service apache2 reload
to reload the Apache2 configuration.
Upvotes: 86
Reputation: 968
If anyone gets
ERROR: Module phpX.X does not exist!
just install the module for your current php version:
apt-get install libapache2-mod-phpX.X
Upvotes: 82
Reputation: 411
You have two ways to enable it.
First, you can set the absolute path of the php module file in your httpd.conf file like this:
LoadModule php5_module /path/to/mods-available/libphp5.so
Second, you can link the module file to the mods-enabled directory:
ln -s /path/to/mods-available/libphp5.so /path/to/mods-enabled/libphp5.so
Upvotes: 7