Skip to content
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

Remote php interpreter Laravel root directory problem #120

Closed
Guilhem-DELAITRE opened this issue Oct 29, 2021 · 5 comments
Closed

Remote php interpreter Laravel root directory problem #120

Guilhem-DELAITRE opened this issue Oct 29, 2021 · 5 comments

Comments

@Guilhem-DELAITRE
Copy link

Stange problem here :

My setup is as follow : my php interpreter is "remote" : ssh connection to a local running VM

It so happens that when i try to run the tinker console, I got this phpstorm notification :
"The configured laravel root is not a directory
Please check if it's the right path. Using a guessed vendor path for now."

The strange thing is that if I take the path in "Laravel root folder", and put "cd path" in my .bashrc, it actually works, which means that the directory definetely exists.

I looked in the repository and came to this (PhpArtisanTinkerUtil.kt line 56)

if (projectSettings.laravelRoot.isNotEmpty()) {
    val customLaravelRoot = File(projectSettings.laravelRoot)
    
    if (customLaravelRoot.exists() && customLaravelRoot.isDirectory) {
        val customComposerDir = File(customLaravelRoot.path + "/vendor")
        
        if (customComposerDir.exists() && customComposerDir.isDirectory) {
            laravelRoot = projectSettings.laravelRoot
        } else {
            LaravelRootDoesNotHaveVendorBalloon(project).show()
        }
    } else {
        LaravelRootDoesNotExistBalloon(project).show()
    }
}

As far as I understand it (not that much), this is for local php interpreter, and I didn't find anything related to remote :
did I missed something ?

@Guilhem-DELAITRE Guilhem-DELAITRE changed the title Laravel root directory problem Remote php interpreter Laravel root directory problem Oct 29, 2021
@Roboroads
Copy link
Owner

Roboroads commented Oct 29, 2021

You might want to leave your laravel root empty in the settings - it will pick one automatically.

Please check if your path mapping is correct like i suggest here #48 (comment)

@Guilhem-DELAITRE
Copy link
Author

Thanks, path mapping worked perfectly (configured tinker plugin to point to local laravel folder and mapped local laravel folder to remote laravel folder in the php interpreter Path mappings).

I'd just like to point that
"When using remote, manually fill in the path as if on the remote" (which appears under the "Laravel root folder" field)
actually hinted me AGAINST using mapping, because it suggested that I enter the path as if I was on the remote system.
I don't know if it's the case for all remote interpreter (ssh, wsl, docker, etc), but maybe you could change the sentence by
"When using remote, make use of PHP interpreter Path mappings)

@Roboroads
Copy link
Owner

Yep! You are right, that is info I thought was right and forgot to change. Thanks!

Roboroads added a commit that referenced this issue Oct 29, 2021
@Roboroads
Copy link
Owner

@Guilhem-DELAITRE Text is changed in the next release :)

@Roboroads
Copy link
Owner

This issue is now released and accepted! You can update via your IDE plugins settings :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants