generated from JetBrains/intellij-platform-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NOTICE] FAQ, read before posting! #250
Labels
Comments
This was referenced Apr 18, 2023
@Roboroads, as pointed out in #249, there is one additional case you could implement. `$app = require_once DIR . $relativeCustomProjectDirectory . '/bootstrap/app.php'; But for this, you require an option that denotes that path of the plugin path input has to be treated as relative. |
@dennyweiss Added it to the list :) |
Roboroads
changed the title
[NOTICE] Class / File not found errors? Read this first!
[NOTICE] FAQ, read before posting!
Aug 30, 2023
1 task
This was referenced Apr 21, 2024
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! Before you post a bug, please first check your interpreter settings. Most likely, your interpreter or path mappings are incorrect and this has nothing to do with the plugin.
Connection to database failed But site/tinker CLI works fine
99.9% sure you are using a local interpreter whilst your application is running in docker or a VM. In that case, the PHP tinker is using can, indeed, not reach your DB.
Go to your settings, and under PHP check your interpreter. Make sure you are using the same PHP executable as your CLI does. E.g., if you use sail, make sure you use the docker compose interpreter on your PHP container (laravel.test). If you use SSH (homestead/vagrant/vm/VPS) use the vagrant or SSH option.
If you do not have these options, make sure you have the "remote interpreters" plugin installed. It's bundled in PHPStorm, but not in IntelliJ
Cannot find classes or helper functions, error in
/in/nmH3n
orLaravelTinkerConsole.php
Tinker runs your (and it's) code through the command line using something like
php -r '<tinker init code>' '<your code>' '<tinker settings>'
. So, if you receive an error that is in a file that's not from your project, like/in/nmH3n
(or some other random characters) or a file ending withLaravelTinkerConsole.php
you are not running your file through the Tinker plugin.In this case: make sure you do not use the default buttons and run commands the IDE gives you. Also stay away from the buttons with "3v4l.org" references. Do use the buttons and shortkeys Tinker has added:
An error with the Tinker run code would not be a file but something like
in Command line code:1
Mounted volumes
If you use a remote/docker interpreter, please make sure that your project is shared with the interpreter. The interpreter you are using also needs to have access to all the files of your project. Also make sure that the working directory of the interpreter is setup in the forlder where your project is located on the interpreter.
If you're using an interpreter via SSH, make sure your project is fully uploaded to the interpreter and stays in sync.
Path mappings
Then, if your project is mounted, please also make sure that the right directory in the interpreter is also mapped to the absolute path on the host to the absolute path on the interpreter. That way, Tinker knows where to find your project.
Where to find this
Tinker Settings
If you can't change the working directory or your vendor/laravel folder is located somewhere else, tou can force override the folder (of the interpreter) in the project settings of the tinker plugin. You can find those under Tools > Laravel Tinker > Project settings.
3v4l.org
In a later update PHPStorm added running code in 3v4l.org - this is the play button you find above your tinker consoles (red arrow). Note that this play button does not run your code with Tinker. Use the green tinker icon in the gutter (green arrow), or any of the other 5 ways to run the tinker console (like the hotkey).
Still having problems?
I doubt I can help you. These errors are 99,9% related to the interpreter settings - which Tinker uses to execute your PHP code.
The text was updated successfully, but these errors were encountered: