{
    use esmith::config;
    use esmith::db;

    local %services = ( php => $php );

    my $status = db_get_prop(\%services, 'php', 'status') || 'disabled';

    if ($status eq 'enabled')
    {
	local %accounts;
	tie %accounts, 'esmith::config', '/home/e-smith/accounts';

	foreach my $key (grep
		{ db_get_type(\%accounts, $_) eq 'ibay' } keys %accounts)
	{
	    local $dynamicContent =
		db_get_prop(\%accounts, $key, 'CgiBin') || 'disabled';
	    if ($dynamicContent eq 'enabled')
	    {
		$OUT .= "\n<Directory /home/e-smith/files/ibays/$key/html>\n";
		$OUT .=
		    "    AddType application/x-httpd-php .php .php3 .phtml\n";
		$OUT .=
		    "    AddType application/x-httpd-php-source .phps\n";

		# Set the sandbox within which PHP is confined to play
		my $basedir = db_get_prop(\%accounts, $key, 'PHPBaseDir') ||
		    "/home/e-smith/files/ibays/$key";
		$OUT .=
		    "    php_admin_value open_basedir $basedir\n";

		$OUT .= "</Directory>\n";
	    }
	}
    }
}
