XF 2.2 [E_WARNING] curl_setopt_array(): Unable to create temporary file

Salamanca

Active member
Hi,

We're testing Xenforo 2.2 RC2, and we're getting this error on the admin, and other similar errors.
I know this looks like a permissions problem, but i'm absolutely sure that the permissions for the php temp folder are set correctly, as other applications use it. cURL also works from other applications.

Code:
ErrorException: [E_WARNING] curl_setopt_array(): Unable to create temporary file. in src\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php at line 56
XF::handlePhpError()
curl_setopt_array() in src\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php at line 56
GuzzleHttp\Handler\CurlFactory->create() in src\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php at line 39
GuzzleHttp\Handler\CurlHandler->__invoke() in src\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php at line 28
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() in src\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php at line 51
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() in src\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php at line 66
GuzzleHttp\PrepareBodyMiddleware->__invoke() in src\vendor\guzzlehttp\guzzle\src\Middleware.php at line 30
GuzzleHttp\Middleware::GuzzleHttp\{closure}() in src\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php at line 70
GuzzleHttp\RedirectMiddleware->__invoke() in src\vendor\guzzlehttp\guzzle\src\Middleware.php at line 58
GuzzleHttp\Middleware::GuzzleHttp\{closure}() in src\vendor\guzzlehttp\guzzle\src\HandlerStack.php at line 67
GuzzleHttp\HandlerStack->__invoke() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 277
GuzzleHttp\Client->transfer() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 125
GuzzleHttp\Client->requestAsync() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 131
GuzzleHttp\Client->request() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 89
GuzzleHttp\Client->__call() in src\XF\Service\Upgrade\Checker.php at line 73
XF\Service\Upgrade\Checker->check() in src\XF\Admin\Controller\Tools.php at line 408
XF\Admin\Controller\Tools->actionUpgradeCheck() in src\XF\Mvc\Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2300
XF\App->run() in src\XF.php at line 464
XF::runApp() in admin.php at line 13

Thanks
Alex
 
Solved. It was actually an error with the SSL on IIS that caused this.
We are getting this same error when testing PHP 8.1. It occurs when trying to add a photo to the XFMG. Everything works fine when we roll back to PHP 7.4 or 7.3 and the server uses the latest cacert.pem from https://curl.se/ca/cacert.pem

The same temporary folder is used for PHP 7.3/7.4/8.1 and is set in all 3 php.ini files.

Even though there is an error when adding/deleting a photo, the photo is added/deleted successfully, an indicator that the file was uploaded to the temp folder. The same temp folder works fine in PHP 7.3/7.4

ErrorException: Template error: [E_WARNING] curl_setopt_array(): Unable to create temporary file. src\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:56


Code:
ErrorException: [E_WARNING] curl_setopt_array(): Unable to create temporary file. in src\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php at line 56
XF::handlePhpError()
curl_setopt_array() in src\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php at line 56
GuzzleHttp\Handler\CurlFactory->create() in src\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php at line 39
GuzzleHttp\Handler\CurlHandler->__invoke() in src\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php at line 28
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() in src\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php at line 51
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}() in src\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php at line 37
GuzzleHttp\PrepareBodyMiddleware->__invoke() in src\vendor\guzzlehttp\guzzle\src\Middleware.php at line 30
GuzzleHttp\Middleware::GuzzleHttp\{closure}() in src\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php at line 70
GuzzleHttp\RedirectMiddleware->__invoke() in src\vendor\guzzlehttp\guzzle\src\Middleware.php at line 58
GuzzleHttp\Middleware::GuzzleHttp\{closure}() in src\vendor\guzzlehttp\guzzle\src\HandlerStack.php at line 67
GuzzleHttp\HandlerStack->__invoke() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 277
GuzzleHttp\Client->transfer() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 98
GuzzleHttp\Client->sendAsync() in src\vendor\guzzlehttp\guzzle\src\Client.php at line 106
GuzzleHttp\Client->send() in src\addons\XFES\Elasticsearch\Api.php at line 388
XFES\Elasticsearch\Api->request() in src\addons\XFES\Elasticsearch\Api.php at line 92
XFES\Elasticsearch\Api->version() in src\addons\XFES\Elasticsearch\Api.php at line 109
XFES\Elasticsearch\Api->majorVersion() in src\addons\XFES\Elasticsearch\Api.php at line 136
XFES\Elasticsearch\Api->isTypelessIndex() in src\addons\XFES\Elasticsearch\Api.php at line 350
XFES\Elasticsearch\Api->requestById() in src\addons\XFES\Elasticsearch\Api.php at line 154
XFES\Elasticsearch\Api->index() in src\addons\XFES\Search\Source\Elasticsearch.php at line 56
XFES\Search\Source\Elasticsearch->index() in src\addons\SV\ElasticSearchEssentials\XFES\Search\Source\Elasticsearch.php at line 65
SV\ElasticSearchEssentials\XFES\Search\Source\Elasticsearch->index() in src\XF\Search\Search.php at line 42
XF\Search\Search->index() in src\addons\SV\ElasticSearchEssentials\XF\Search\Search.php at line 43
SV\ElasticSearchEssentials\XF\Search\Search->index() in src\XF\Behavior\Indexable.php at line 48
XF\Behavior\Indexable->XF\Behavior\{closure}() in src\XF.php at line 370
XF::triggerRunOnce() in src\XF\Mvc\Dispatcher.php at line 158
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2351
XF\App->run() in src\XF.php at line 517
XF::runApp() in index.php at line 20

curl.jpg
 
Last edited:
SOLVED! On PHP 7.3 & 7.4 for some reason, we did not have to specify a path for sys_temp_dir. I added this in the 8.1 php.ini file and everything is working as expected!
 
Top Bottom