I'm pretty new to PHPStorm, but I've ran into this problem where PHPStorm can't resolve the path which starts at the root of my project folder.
Like this:
PHPStorm can resolve the path when I put
dirname(__dir__)
in front of the name, but then I can't test my website using the run button.
When I use relative paths with ../.. PHPStorm recognizes the path as well, but again it doesn't work when testing the site, I also would rather not use relative paths.
PHPStorm is able to resolve the path from test.php which is in my root folder, but I'd like it to be able to resolve it from anywhere in my project.
Any help?
Looks like your server know include path for your project folder, so relative paths like Model/Exposition.php
work well. You can check include paths with get_include_path() function.
PHPStorm has its own list of include paths for project, which you can check and modify:
File > Settings
(or Ctrl+Alt+S
)Language & Frameworks > PHP
, and look at Include Path
tab.C:\Users\Ruben\Documents\Multec...\Server
).So finally PHPStorm will know where to find these files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With