curl follow location error

前端 未结 6 1089
耶瑟儿~
耶瑟儿~ 2020-11-27 06:48

I got this error message:

CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in.

safe_mode i

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 07:45

    The only place where this warning message is printed is in ext/curl/interface.c

    if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
      if (Z_LVAL_PP(zvalue) != 0) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set");
        RETVAL_FALSE;
        return 1;
      }
    }
    

    As you can see from the if-condition either open_basedir or safe_mode must be enabled.

提交回复
热议问题