Permission denied: exec of ... failed

If this happens when trying to access a normal (non CGI) html page, then look in the config file for the directive:

SetHandler cgi-script

The above directive force everything to be considered a CGI script; to fix this remove the directive or (if you need to execute CGI scripts) replace it with something like the following:

AddHandler cgi-script .cgi .pl


PHP not enabled in userdir directories

Comment (or remove) the following lines in /etc/apache2/mods-enabled/php5.conf:

  <IfModule mod_userdir.c>
      <Directory /home/*/public_html>
          php_admin_value engine Off
      </Directory>
  </IfModule>