PHPStorm settings for testing and debugging.
This was moved from readme.io on Feb 4th 2019.
Type | SFTP |
SFTP host | 127.0.0.1 |
Port | 222 |
Root path | /app/foo (if Drumeo put /app/drumeo/laravel ?) |
Username | root |
Auth type | Password |
Password | Leave this blank but select Save Password checkbox. |
Web server root URL | http://127.0.0.1 |
click "Test SFTP connection..."
Local path (connect the project's roots*) | /home/jonathan/railenv/applications/foo → /app/foo |
Deployment path on server 'foo' | / |
Web path on server 'foo' | / |
* connect the your application|project on your machine with its representation in railenvironment (basically your VM)
"From Docker, Vagrant, VM, Remote..."
select Deployment Configuration you created above
Name | (whatever you want) |
Visible only for this project | (selected) |
Deployment Configuration | the one you created above |
PHP executable | /usr/bin/php |
Click "reload" icon
Name | foo |
Shared | no |
Host | dev.foo.com |
Port | 443 |
Debugger | Xdebug |
Configure mapping
- Test Frameworks
- "PHPUnit by Remote Interpreter".
- select CLI Intepreter created above
- "CLI Interpreter" and "Path Mappings" options should be automatically filled out.
- "Use Composer autoloader"
- "Path to script" likely
/app/foo/vendor/autoload.php
- "Default configuration file": likely
/app/foo/phpunit.xml
- Settings → Build, Execution, Deployment → Deployment → Add (Insert)
- Set the name
dev.foo.com
("foo" is used as an example - obviously replace with your application|package name) - in "Connection" tab:
- Type: SFTP
- SFTP host:
127.0.0.1
- Port:
222
- Root path:
/app/foo
(if Drumeo, put/app/drumeo/laravel
?) - Username:
root
- Auth type: Password
- Password: Leave this blank, but select Save Password checkbox.
- Web server root URL:
http://127.0.0.1
- Verify correct config with "Test SFTP connection..." button.
- "Mappings":
- Local path: the path to the application dir. Probably something like one of these:
C:\web-development-environment\railenvironment\applications\foo
(windows)/home/jonathan/railenv/applications/guitareo
(linux)- "Deployment path on server 'dev.foo.com' ":
/
- "Web path on server 'dev.foo.com' ":
/
- "OK" or "Apply" save.
(Must complete steps below before can verify correct)
- Settings → Languages & Frameworks → PHP.
- start creation of new "CLI Interpreter":
- Click the "three dots" to right of the "CLI Interpreter" field. A new windows will open.
- Click Create green arrow
- Select "From Docker, Vagrant, VM, Remote..."
- In Configure Remote PHP Interpreter dialog box
- select Deployment Configuration you created above
- "PHP interpreter path" set to:
/usr/bin/php
- "CLI Interpreters" window:
- Name:
railenvironment-php-71-foo
- "Visible only for this project" selected
- Select "Deployment Configuration" radio button.
- Select the Deployment Configuration you created above (ex: "dev.foo.com").
- PHP executable:
/usr/bin/php
- Click "reload" icon right of input, ("Reload phpinfo"). This will populate "PHP version" and "Configuration file" fields.
- Leave empty:
- Debugger extension
- Configuration options
- "OK" or "Apply" save.
- Settings → Languages & Frameworks → PHP → Servers
- Click green Add (Insert) cross
- Settings:
- Name:
dev.foo.com
- Select the "Shared" checkbox.
- Host:
dev.foo.com
- Port:
443
- Debugger: Xdebug
- Select "Use path mappings"
- TL;DR: connect project root on your machine and in your local dev environment (railevironment)
- details: select this option to map the project on your computer to it's location in the server. Map to and from the Laravel root*. This is often also the project root (ex: "/app/pianote).
- However, Drumeo's Laravel root is not the project root, so map to the "laravel" dir, not the root. Like this: "/app/drumeo/laravel" (is mapped to /web-development-environment/railenvironment/applications/drumeo/laravel/)
* unless—of course— Laravel is not used
- Settings → Languages & Frameworks → PHP → Test Frameworks
- Click green "Add (Insert)" cross
- select "PHPUnit by Remote Interpreter".
- Prompt will open
- select the CLI Intepreter you created above
- perhaps "railenvironment-php-71-foo"
- Settings:
- "CLI Interpreter" and "Path Mappings" options should be automatically filled out.
- In "PHPUnit Library" section:
- Select "Use Composer autoloader"
- "Path to script": likely
/app/foo/vendor/autoload.php
* - In "Test Runner" section:
- "Default configuration file": likely
/app/foo/phpunit.xml
*
* can also navigate to it via "three dots" button
Create a project in PHPStorm with your project root as the shared root of your package project files and the project files of the application you're using for manually testing the package.
Adjust application of above note accordingly.
(In other words, this section is WIP—feel free to improved with more helpful guide if possible)