2

I came across this problem: get_headers(): SSL operation failed with code 1

Now in the answer above it mentioned that stream_context_create and stream_context_set_default differs in that stream_context_create does not override the defaults. But I am still feeling ambiguous about what does it mean for "overriding the defaults".

For a server based on framework such as Laravel, which creates an "independent execution instance" for each request, the behavior of stream_context_set_default can have one of the two outcomes:

(1) It overrides some internal setting files so that all subsequent requests coming in to the same server will behave differently after using stream_context_set_default.

(2) It only overrides the setting for the current "code execution life-time" so that subsequent requests are not affected.

Which way is it?

cr001
  • 655
  • 4
  • 16
  • Have you seen the reference? https://www.php.net/manual/en/function.stream-context-set-default.php – shingo Jun 25 '22 at 04:47

0 Answers0