# After Apache upgrade CGI stops working [SOLVED]

## binro

I have just made the minor upgrade of apache-2.4.9-r2 to apache-2.4.9-r3 and when I restarted it I get:

May 24 19:15:44 opal apache2[16294]: [cgi:error] [pid 16294] [client 127.0.0.1:49885] Options ExecCGI

is off in this directory: /var/www/localhost/htdocs/nagios/cgi-bin/status.

and all my PHP apps now just display the code. There were no significant changes to /etc/apache2 and my httpd.conf file has always contained:

```

Options +ExecCGI

AddHandler cgi-script .cgi

```

Any ideas what has gone wrong?

TIA

----------

## binro

I fixed the problem with Nagios, it now requires a "-D NAGIOS" in the APACHE2_OPTS variable. But I still have the problem with php virtual hosts where the php script just gets displayed. Here is my /etc/apache2/modules.d/00_default_settings.conf:

<IfDefine DEFAULT_VHOST>

Listen 80

<VirtualHost *:80>

	ServerName localhost

	Include /etc/apache2/vhosts.d/default_vhost.include

		# Keep PHP applications separate

		Alias "/phpsyslogng" "/var/www/phpsyslogng"

		<Directory "/var/www/phpsyslogng">

                        Options +Indexes +FollowSymLinks +ExecCGI

			Require all granted 

		</Directory>

		Alias "/phpmyadmin" "/var/www/phpmyadmin"

		<Directory "/var/www/phpmyadmin">  

                        Options +Indexes +FollowSymLinks +ExecCGI

			Require all granted 

		</Directory>

</VirtualHost>

</IfDefine>

Aany idea why this is suddenly not working after years?

----------

## toralf

This works for me : http://bpaste.net/show/307461/

----------

## binro

 *toralf wrote:*   

> This works for me : http://bpaste.net/show/307461/

 

Thanks but I have exactly the same definitions.  :Smile: 

----------

## binro

Doh! All it was was that APACHE2_OPTS in /etc/conf.d/apache2 needed a "-D PHP5" added to activate the PHP5 module. I have seen no warning about this and the comments in the conf.d file have not been updated.

----------

