spatie / laravel-web-tinker

Tinker in your browser
https://spatie.be/open-source
MIT License
1.04k stars 68 forks source link

touch(): Utime failed #33

Closed kidipridi closed 4 years ago

kidipridi commented 5 years ago

Running to this error local.ERROR: touch(): Utime failed: Invalid argument {"exception":"[object] (ErrorException(code: 0): touch(): Utime failed: Invalid argument at C:\laragon\www\laravel6\vendor\psy\psysh\src\ConfigPaths.php:233)

Windows 10, laravel 6.0, PHP 7.2.18

It has something to do with this piece of code in Tinker.php :

$config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? 'nul' : '/dev/null');

I don't know with other people, but nul file just doesn't work on my computer, so change it to something like :

$config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? base_path().'/web-tinker-history.txt' : '/dev/null');

solves the problem. At least it's working as a temporary fix until the real culprit is found

gdesoto-lhs commented 5 years ago

I'm getting the same error. Windows OS PHP 7.2.7 Laravel 6.0

I just installed laravel-web-tinker, published packages, went to the /tinker route and Ctrl + Enter did nothing. Looking through the logs I found the same errors referenced above.

If you run touch('nul') in a script by itself, PHP throws the warning: PHP Warning: touch(): Utime failed: Invalid argument

The line in Tinker.php(233) looks like it was just added a couple days ago: 94d9ed8453927b4af5bfca8100e8b0a442df4ad7

I'm not sure what the line was fixing, but Windows and/or PHP doesn't like it.

Since I'm not use what the point of the line is (updating the timestamp of nothing?), I commented it out and the that resolved the error and allowed the package to works.

WSBrendonBallantyne commented 5 years ago

Same here. Ctrl + Enter gives no response. Console log gives a 500 Internal Server Error: Uncaught (in promise) Error: Request failed with status code 500 at FtD3.e.exports (app.js?id=54675ea5df087610508e:1) at e.exports (app.js?id=54675ea5df087610508e:1) at XMLHttpRequest.d.onreadystatechange (app.js?id=54675ea5df087610508e:1)

Commenting out this line in the Tinker.php vendor file makes it work again: $config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? 'nul' : '/dev/null');

I'm running: Windows 8. Xampp 3.2.2. PHP 7.2.10 Laravel 5.8 Web tinker 1.5

Hope this helps narrow down the cause, and thank you for this package.

nikitabuida commented 5 years ago

Same issue here. I'm on Windows 10 with Laragon.

php 7.2.19 Laravel 6.0.3 Web Tinker 1.5

gbdematos commented 5 years ago

Same issue.

Windows 10 with Laragon. PHP 7.2.19 Laravel 5.8 Web Tinker 1.5

gdesoto-lhs commented 5 years ago

Just an fyi for those subscribed... I updated to 1.5.3 and this issue no longer occurs for me.

ghost commented 4 years ago

(Fixed in #42)