How to define a webroot different than the project root ?


I'm currently trying PhpStorm, and it seems to be a great IDE (although it's a little slow on my old computeur ^^ ).

I have a project like this one :


In my HTML code, I've for example : <img src="/images/my_image.jpg" /> ... But PhpStorm give me an error, saying that it doesn't find the "images" directory (because it search inside "project_root" rather than "web_root" )

Is there a way to change that ?

Thank you.


This is also valid for MVC. Basically the view file can't see the controller's paths


-images (dir)

-controller (dir)

-view (dir)

The view will only be accessed through the controller, basically in the controller.php you include view.php. When you edit view.php, all the links that go through controller.php are not marked as valid. To be more precise, the link images/image.jpg will be marked as invalid.


Basically you should add all folders from your php include_path and all folders where your server looks for resources to Settings|Directories.

The problem is that current builds still not allow you to include both / (root) and its subfolder (i.e. /web_root).
See and

Please sign in to leave a comment.