Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 797)
@@ -77,4 +77,7 @@
 	g++ -c ${XML2CFLAGS} ${PHPCFLAGS} ${CFLAGS}  ${PHP_ENABLED} service_internal_php.c
 
+service_internal_php7.o: service_internal_php7.c service.h
+	g++ -c ${XML2CFLAGS} ${PHPCFLAGS} ${CFLAGS}  ${PHP_ENABLED} service_internal_php7.c
+
 service_internal_perl.o: service_internal_perl.c service.h
 	gcc -c ${XML2CFLAGS} ${PERLCFLAGS} ${CFLAGS}  ${PERL_ENABLED} service_internal_perl.c
Index: /trunk/zoo-project/zoo-kernel/caching.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/caching.c	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/caching.c	(revision 797)
@@ -154,7 +154,8 @@
  * @param index the input index
  * @param hInternet the internet connection
- * @return 0 in case of success, 4 in case of failure
- */
-int readCurrentInput(maps** m,maps** in,int* index,HINTERNET* hInternet){
+ * @param error the error map pointer
+ * @return 0 in case of success, -1 in case of failure
+ */
+int readCurrentInput(maps** m,maps** in,int* index,HINTERNET* hInternet,map** error){
   map* tmp1;
   char sindex[5];
@@ -207,8 +208,8 @@
       
       if(getMap(content->content,icname)==NULL){
-	
 	fcontent=(char*)malloc((hInternet->ihandle[*index].nDataLen+1)*sizeof(char));
 	if(fcontent == NULL){
-	  return errorException(*m, _("Unable to allocate memory"), "InternalError",NULL);
+	  errorException(*m, _("Unable to allocate memory"), "InternalError",NULL);
+	  return -1;
 	}
 	size_t dwRead;
@@ -231,4 +232,23 @@
 	}
 	memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char));
+	if(hInternet->ihandle[*index].code!=200){
+	  char *error_rep_str=_("Unable to download the file for the input <%s>, response code was : %d.");
+	  char *error_msg=(char*)malloc((strlen(error_rep_str)+strlen(content->name)+4)*sizeof(char));
+	  sprintf(error_msg,error_rep_str,content->name,hInternet->ihandle[*index].code);
+	  if(*error==NULL){
+	    *error=createMap("text",error_msg);
+	    addToMap(*error,"locator",content->name);
+	    addToMap(*error,"code","InvalidParameterValue");
+	  }else{
+	    int nb=1;
+	    map* tmpMap=getMap(*error,"length");
+	    if(tmpMap!=NULL)
+	      nb=atoi(tmpMap->value);
+	    setMapArray(*error,"text",nb,error_msg);
+	    setMapArray(*error,"locator",nb,content->name);
+	    setMapArray(*error,"code",nb,"InvalidParameterValue");
+	  }
+	  return -1;
+	}
 	
 	char ltmp1[256];
@@ -266,7 +286,9 @@
  *  per default based on the zcfg file)
  * @param hInternet the HINTERNET pointer
- * @return 0 on success
- */
-int runHttpRequests(maps** m,maps** inputs,HINTERNET* hInternet){
+ * @param error the error map pointer
+ * @return 0 on success, -1 on failure
+ */
+int runHttpRequests(maps** m,maps** inputs,HINTERNET* hInternet,map** error){
+  int hasAFailure=0;
   if(hInternet!=NULL && hInternet->nb>0){
     processDownloads(hInternet);
@@ -277,14 +299,19 @@
 	maps* cursor=content->child;
 	while(cursor!=NULL){
-	  readCurrentInput(m,&cursor,&index,hInternet);
+	  int red=readCurrentInput(m,&cursor,&index,hInternet,error);
+	  if(red<0)
+	    hasAFailure=red;
 	  cursor=cursor->next;
 	}
       }
-      else
-	readCurrentInput(m,&content,&index,hInternet);
+      else{
+	int red=readCurrentInput(m,&content,&index,hInternet,error);
+	if(red<0)
+	  hasAFailure=red;
+      }
       content=content->next;
-    } 
-  }
-  return 0;
+    }
+  }
+  return hasAFailure;
 }
 
Index: /trunk/zoo-project/zoo-kernel/caching.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/caching.h	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/caching.h	(revision 797)
@@ -32,5 +32,5 @@
   void addToCache(maps*,char*,char*,char*,int,char*,size_t);
   char* isInCache(maps*,char*);
-  int runHttpRequests(maps**,maps**,HINTERNET*);
+  int runHttpRequests(maps**,maps**,HINTERNET*,map**);
   void addRequestToQueue(maps**,HINTERNET*,const char*,bool);
   int loadRemoteFile(maps**,map**,HINTERNET*,char*);
Index: /trunk/zoo-project/zoo-kernel/configure.ac
===================================================================
--- /trunk/zoo-project/zoo-kernel/configure.ac	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/configure.ac	(revision 797)
@@ -422,5 +422,5 @@
 	if test  "$PYTHON_PATH" = "yes"
 	then
-		# PHP was not specified, so search within the current path
+		# PYTHON was not specified, so search within the current path
 		PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
 		if test -z "${PYTHONCFG_PATH}" ; then
@@ -529,4 +529,8 @@
 	[PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
 
+AC_ARG_WITH([php-version], 
+	[AS_HELP_STRING([--with-phpvers=NUM], [To use a specific php version])], 
+	[PHP_VERS="$withval"], [PHP_VERS=""])
+
 
 if test -z "$PHP_ENABLED"
@@ -535,5 +539,10 @@
 else
 	PHPCONFIG="$PHP_PATH/bin/php-config"
-	PHP_FILE="service_internal_php.o"
+	if test "x$PHP_VERS" = "x7"
+	then
+		PHP_FILE="service_internal_php7.o"
+	else
+		PHP_FILE="service_internal_php.o"
+	fi
 	if test  "$PHP_PATH" = "yes"
 	then
@@ -545,5 +554,10 @@
 
 	# Extract the linker and include flags 
-	PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
+	if test "x$PHP_VERS" = "x7"
+	then
+		PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib64 -lphp7"
+	else
+		PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
+	fi
 	PHP_CPPFLAGS=`$PHPCONFIG --includes`
 
@@ -558,5 +572,11 @@
 	LIBS="$PHP_LDFLAGS"
 	# Shouldn't we get php here rather than php5 :) ??
-	AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
+	if test "x$PHP_VERS" = "x7"
+	then
+		echo $LIBS
+		#AC_CHECK_LIB([php7], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
+	else
+		AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
+	fi
 	LIBS="$LIBS_SAVE"
 	AC_SUBST([PHP_CPPFLAGS])
Index: /trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 797)
@@ -1515,6 +1515,13 @@
 int validateRequest(maps** main_conf,service* s,map* original_request, maps** request_inputs,maps** request_outputs,HINTERNET* hInternet){
 
-  runHttpRequests (main_conf, request_inputs, hInternet);
+  map* errI0=NULL;
+  runHttpRequests (main_conf, request_inputs, hInternet,&errI0);
+  if(errI0!=NULL){
+    printExceptionReportResponse (*main_conf, errI0);
+    InternetCloseHandle (hInternet);
+    return -1;
+  }
   InternetCloseHandle (hInternet);
+
 
   map* errI=NULL;
Index: /trunk/zoo-project/zoo-kernel/response_print.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/response_print.c	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/response_print.c	(revision 797)
@@ -2206,5 +2206,5 @@
  * 
  * @param m the maps containing the settings of the main.cfg file
- * @param s the map containing the text,code,locator keys
+ * @param s the map containing the text,code,locator keys (or a map array of the same keys)
  */
 void printExceptionReportResponse(maps* m,map* s){
Index: /trunk/zoo-project/zoo-kernel/ulinet.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/ulinet.c	(revision 796)
+++ /trunk/zoo-project/zoo-kernel/ulinet.c	(revision 797)
@@ -92,10 +92,11 @@
 #endif
     sscanf((char*)buffer,"%s; path=%s; domain=%s",env,path,domain);
-    tmp=strcat(env,CCookie[0]);
+    _HINTERNET *psInternet=(_HINTERNET *)data;
+    tmp=strcat(env,CCookie[psInternet->id][0]);
 #ifdef MSG_LAF_OUT
     printf("\n**Cookie env : [%s] , path : [%s], domain : [%s]**\n",env,path,domain);
     printf("buffer : %d (%s) (%s) (%s)\n",(buffer==NULL),buffer,tmp,CCookie);
 #endif
-    strcpy(CCookie[0],tmp);
+    strcpy(CCookie[psInternet->id][0],tmp);
   }
   return size * nmemb;//write_data_into(buffer,size,nmemb,data,HEADER);
