Page MenuHomePhabricator

MW-Vagrant's docroot should be available from the host machine
Closed, ResolvedPublic

Description

Since the multiwiki features were added, debugging is broken in Vagrant. If you try to use it, you get something like this:


This is in PHPStorm, maybe other IDEs are more clever, I don't know. But at the very least it is impossible to debug multiwiki issues since the PHP files under /var/www are not accessible from the host machine. Vagrant should put those files under /vagrant/docroot or something and symlink /var/www to that (or copy if symlinking is problematic although the ability to access and alter those files from an IDE would be nice).

Event Timeline

Tgr created this task.Jan 30 2015, 8:21 PM
Tgr updated the task description. (Show Details)
Tgr raised the priority of this task from to Needs Triage.
Tgr added a project: MediaWiki-Vagrant.
Tgr added a subscriber: Tgr.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 30 2015, 8:21 PM
Tgr added a comment.Jan 31 2015, 3:02 AM

Placing the files under /vagrant runs into permission problems due to NFS root squashing. I guess it will have to be done via copying.

gerritbot added a subscriber: gerritbot.

Change 187874 had a related patch set uploaded (by Gergő Tisza):
Make sure all PHP files are available from the host machine

https://gerrit.wikimedia.org/r/187874

Patch-For-Review

Tgr added a comment.Jan 31 2015, 4:19 AM

Doesn't work very reliably, some files are not picked up on the first provisioning run. Probably a timing issue.

Setting up the directories for remote debugging is not very user-friendly in PHPStorm. This snippet can be added to .idea/workspace.xml to fix it:

<component name="PhpServers">
  <option name="servers">
    <server host="<host>" name="<host>" port="<port>" use_path_mappings="true">
      <path_mappings>
        <path_mapping local_path="$PROJECT_DIR$/docroot" remote_path="/var/www" />
        <path_mapping local_path="$PROJECT_DIR$" remote_path="/vagrant" />
      </path_mappings>
    </server>
  </option>
</component>

I don't think there is a good way to do that via the git repo or vagrant, though.

Tgr added a comment.Feb 10 2015, 2:58 AM
In T88149#1005961, @Tgr wrote:

I don't think there is a good way to do that via the git repo or vagrant, though.

Reported that upstream as https://youtrack.jetbrains.com/issue/WI-26425

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 29 2015, 2:05 PM
Ardnet5 added a subscriber: Ardnet5.Jun 4 2016, 4:13 AM

Change 187874 merged by jenkins-bot:
Make sure all PHP files are available from the host machine

https://gerrit.wikimedia.org/r/187874

Tgr added a comment.Dec 13 2016, 8:01 AM

Available as /vagrant/srv/docroot.

Tgr closed this task as Resolved.Dec 13 2016, 8:01 AM
Tgr claimed this task.