Getting the error below when using php-cs-fixer.
Running php-cs-fixer from the command line works just fine.
Also attached Atom debug console info.

[ErrorException]
tempnam(): file created in the system's temporary directory
fix [--config="..."] [--config-file[="..."]] [--dry-run] [--level="..."] [--fixers="..."] [--diff] [--format="..."] [path]
Here is a link to the debug.md Gist: https://gist.github.com/058a4a8d5646024d14f1468da4178225
debug.md Gist to this issuenever mind, seems a bug with my php 7 binary. installing php 5.6 resolved.
This is not a bug - it's a feature. ;-) It is a "bugfix" that was made in PHP 7.1.0 because someone thought, that tempnam() should throw a notice, since it might use different paths for the temporary dir (which is correct). Here is the full list of changes:
http://php.net/ChangeLog-7.php#7.1.0
The bug is listed as "Fixed bug #69489 (tempnam() should raise notice if falling back to temp dir)."
And here is the ticket:
https://bugs.php.net/bug.php?id=69489
Since this is just a notice and the function still works correctly, you can either place the "@" operator infront of the function call "@tempnam()" or set your personal temp path in your php.ini like this:
upload_tmp_dir = C:\php\temp\
I'm not sure if the last one prevents PHP throwing the notice (I use PHP 7.0.9 and didn't tested it), but I think it will work.
Well, When I am trying to run the PHP unit test on my local, i am getting following
rakeshjames at Rakeshs-MacBook-Pro in ~/Sites/drupal on 8.5.x [!?]
$ sudo -u _www -E ./vendor/bin/phpunit -c core --filter testMigrateUpgrade
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
Testing
tempnam(): file created in the system's temporary directory
It was working fine, till yesterday:(
rakeshjames at Rakeshs-MacBook-Pro in ~/Sites/drupal on 8.4.x [!?$]
$ php --version
PHP 7.1.11 (cli) (built: Nov 3 2017 22:18:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans
I had this problem (in windows OS) with troydavisson\phrets package and I ended up with a solution like below:
'curl' => [ CURLOPT_COOKIEFILE => @tempnam('/tmp', 'phrets') ]
I had this problem (in windows OS) with troydavisson\phrets package and I ended up with a solution like below:
'curl' => [ CURLOPT_COOKIEFILE => @tempnam('/tmp', 'phrets') ]
Can you elaborate your solution?
I am having this same issue with PHRETS.
Thanks!
@enguez form my experience, tempnam function works fine in linux but not windows. If we call it with @ sign, then it works for windows. Since, my development environment is running on my windows, I modified this line in the function getDefaultOptions() of \vendor\troydavisson\phrets\src\Session.php file. In my code, the line number is 481. Better you find and replace tempnam with @tempnam through this file.
Thank you
The @ sign solved my issue. Thank you!
I've the same problem :/ could you please guide me how to solve it?!
Hi @yasserakbbach
Please go to \vendor\troydavisson\phrets\src\Session.php file and find and replace tempnam with @tempnam through this file. Below is the line from my code.
'curl' => [ CURLOPT_COOKIEFILE => @tempnam('/tmp', 'phrets') ]
Most helpful comment
This is not a bug - it's a feature. ;-) It is a "bugfix" that was made in PHP 7.1.0 because someone thought, that tempnam() should throw a notice, since it might use different paths for the temporary dir (which is correct). Here is the full list of changes:
http://php.net/ChangeLog-7.php#7.1.0
The bug is listed as "Fixed bug #69489 (tempnam() should raise notice if falling back to temp dir)."
And here is the ticket:
https://bugs.php.net/bug.php?id=69489
Since this is just a notice and the function still works correctly, you can either place the "@" operator infront of the function call "@tempnam()" or set your personal temp path in your php.ini like this:
upload_tmp_dir = C:\php\temp\
I'm not sure if the last one prevents PHP throwing the notice (I use PHP 7.0.9 and didn't tested it), but I think it will work.