laravel-tinker icon indicating copy to clipboard operation
laravel-tinker copied to clipboard

[Bug]: No Output / Output doesn't show with Version 2.7.3

Open jafar690 opened this issue 1 year ago • 8 comments

Short bug description

any php code that outputs to the console doesn't show

Extended bug description

No response

Your project is not the problem

  • [X] I tried using a fresh laravel install - I'm fairly certain it has nothing to do with my project.

How to reproduce?

<?php

echo 'Hello World';

when i run the above code, I can't see any output.

Expected behavior

i expect to see Hello World printed out.

Screenshots

image

IDE & Version

2024.2.4

PHP Version

8.2.24

OS and version

Mac OS

Laravel Tinker plugin version

2.7.3

Interpreter type

Local

Laravel Version

v10.48.12

Tinker version

v2.9.0

Psysh version

v0.12.4

Additional Context

No response

jafar690 avatar Oct 29 '24 15:10 jafar690

What happens if you remove 'echo'? (So, just the string)

Roboroads avatar Oct 29 '24 15:10 Roboroads

I have the same issue.

When I only write 'Hello world'; I get the same result: image

codeclax avatar Oct 31 '24 10:10 codeclax

same issue here. on phpstorm 2024.3, same plugin version

mariusccc avatar Dec 04 '24 08:12 mariusccc

This issue has been automatically marked as stale because it has not had recent activity. This means this issue is resolved or nobody else has had this issue or feature request. It will be closed if no further activity occurs within 30 days, so if this is still relevant, please let us know!

stale[bot] avatar Feb 02 '25 17:02 stale[bot]

Same problem. In settings->tools->laravel tinker->project settings the paths are correct - project folder. I also use laravel sail. php interpreter is from docker container, until I set it up there were errors in output when running the code. I also use wsl2 After a few minutes, when re-running the code an error appeared, by itself -

PHP Fatal error: Uncaught Exception: \\wsl.localhost\Ubuntu\home\doczzz\dev\lar_10_api\src/composer.json does not exist. Please check your project settings. in Command line code:16 Stack trace: #0 {main} thrown in Command line code on line 16

*** Execution finished ***

DoczzzMega avatar Feb 16 '25 23:02 DoczzzMega

I have the same issue on PhpStorm 2024.3.5 with the same plugin version. I also manually added older versions, but nothing changed.

sphr-sdq avatar Mar 14 '25 21:03 sphr-sdq

Hello, I have same issue with plugin. Please, can you help me ?

  • PhpStorm 2024.3 (Build #PS-243.21565.202, built on November 13, 2024)
  • PHP 8.1.31
  • Mac OS 12.7.6
  • Tinker 2.10.1
  • Psy Shell v0.12.8

abrahamuchos avatar Apr 13 '25 00:04 abrahamuchos

problem seems to be isolated to docker v1. I upgraded to v2 and seems to be working now. fyi.

mariusccc avatar May 13 '25 15:05 mariusccc

Similar Problem on Windows

Image

Laravel Tinker: 2.7.3 Windows 11 - with Herd installed - PHP 8.4 PhpStorm 2025.1.2, Build #PS-251.26094.133, built on June 5, 2025 No Sail or Docker

Tinker Settings Blank in PHPStorm Image

Same BLANK output, Execution Finished when php code is invalid Image

I LOVE the plugn, was working great, previously I was using WSL - all projects were inside ubuntu, but there were some package related errors and I had to move the project to within Windows directly, should have changed OS to Ubuntu, but need Windows for office work.

Hopefully someone can guide me to resolve this issue

zaidpirwani avatar Jun 22 '25 05:06 zaidpirwani

So there is some specific windows problem. I will be looking at this again.

Roboroads avatar Jun 23 '25 08:06 Roboroads

changed php versions, but same problem

Plugin is working on another windows machine, with an older PHPStorm PHPStorm version (working) - PHP8.3 and Laravel Tinker Plugin 2.7.3 Image

I installed new PHPStorm and Laravel Herd on another machine and the plugin doesnt work there as well.

zaidpirwani avatar Jun 24 '25 10:06 zaidpirwani

Getting the same, no output.

Windows 11 Laravel Herd PhpStorm 2025.1.2 Build #PS-251.26094.133, built on June 5, 2025

cp6 avatar Jun 26 '25 01:06 cp6

Reporting in: Problem still there with v3 of the plugin.

Image

zaidpirwani avatar Jun 26 '25 06:06 zaidpirwani

@Roboroads is there any way I can try to debug and investigate this issue, we really loevd using Tinker and it allowed us to see results ASAP. but now we are sort of stuck.

Please help.

THANKS.

I have tested a lot of php and path related matters in Windows and PHP Storm and no difference.

zaidpirwani avatar Jul 04 '25 05:07 zaidpirwani

+1

qweik avatar Jul 13 '25 13:07 qweik

same here

alessondejesus avatar Jul 15 '25 18:07 alessondejesus

One possible way to debug is add a file_put_contents(__DIR__.'/test.txt', 'Testing 1 2 3'); into a script by itself to see if it is actually running.

skeemer avatar Jul 31 '25 20:07 skeemer

Please note that I have been trying to fix this, it's proven to be difficult. It's first priority for the 3.0.1 release. Jetbrains does not document the PHP plugin, meaning I have to decompile it and figure stuff out by reverse engineering.

Roboroads avatar Aug 06 '25 11:08 Roboroads

Thank you for the update, please let me know if you need any assistance from a not so expert coder...

zaidpirwani avatar Aug 06 '25 15:08 zaidpirwani

I have narrowed the bug down - on my machine - to have something to do with Herd. I'm kindof assuming you all use Herd now :P

I have updated the issue template to be able to have this info included as well

Roboroads avatar Aug 06 '25 21:08 Roboroads

I have narrowed the bug down - on my machine - to have something to do with Herd. I'm kindof assuming you all use Herd now :P

I have updated the issue template to be able to have this info included as well

I understand, if you want, I can do a test on a fresh laptop with NO herd and then with Herd an provide you results.

zaidpirwani avatar Aug 07 '25 03:08 zaidpirwani

No need for a fresh laptop; just change your interpreter to another local PHP install (e.g. from winget or WSL). If that works, it's Herd.

Roboroads avatar Aug 07 '25 07:08 Roboroads

for anyone wondering HOW

install additional php on windows - HERD will have its own php, you install another one for tinker to use

use the pwoershell command form php.net

https://www.php.net/downloads.php?usage=cli&os=windows&osvariant=windows-native&version=8.4&multiversion=Y

code I used:

Download and install PHP.

powershell -c "& ([ScriptBlock]::Create((irm 'https://www.php.net/include/download-instructions/windows.ps1'))) -Version 8.4"

then after installation, set PHP interpreter in PHPStorm

Image

tinker should work now

Image

zaidpirwani avatar Aug 19 '25 15:08 zaidpirwani

This issue has been automatically marked as stale because it has not had recent activity. This means this issue is resolved or nobody else has had this issue or feature request. It will be closed if no further activity occurs within 30 days, so if this is still relevant, please let us know!

stale[bot] avatar Oct 18 '25 15:10 stale[bot]

Closing this issue after 90 days of no activity. You may reopen this issue if it's still a think to be looked at!

stale[bot] avatar Nov 18 '25 04:11 stale[bot]