Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable PHP Apache2

Tags:

php

apache

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)!

like image 675
SE_1991 Avatar asked Mar 07 '17 17:03

SE_1991


People also ask

Does apache2 have PHP?

The PHP module for Apache is not bundled with Apache. As such, it must be installed in addition to the Apache package.

How do I enable PHP modules?

Use phpenmod command followed by module name to enable specific PHP module on your system. In the below example, the first command is an example and the second command will enable mbstring module for all installed PHP versions and all SAPI. You can also define the PHP version using -v switch to enable specific modules.


1 Answers

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.

like image 170
Patrick Moore Avatar answered Oct 06 '22 18:10

Patrick Moore