PHPStorm with remote server on same network plus xdebug
Hi ...
I'm new here and I'm new to PHPStorm so please forgive me, if that question was asked before. I couldn't find it though through the search.
I have installed PHPStorm on my local machine. The webserver is another machine that I have connected through VPN. Its an IIS on a W2012R2 with xDebug installed.
I would like to edit my sources directly on the server and also being able to use xDebug. I cannot however get it to run at all. It seems that you have to have the webserver on your development system and you need a copy of your sources on your PC as well. Right now I can directly edit the sources on my local machine using a share, but that doesn't help with the debugging. Also my local machine obviously doesn't have php installed, so that fails, too.
Please advise.
Cheers,
Guenter
Please sign in to leave a comment.
Hi there,
First of all -- some links:
>I would like to edit my sources directly on the server...
>Right now I can directly edit the sources on my local machine using a share,
In general it's not recommended way at all. IDE requires fast access to source files (otherwise you may see random short freezes in the middle of typing a word etc) therefore the recommended way is to have local copy of your files and then setup automatic deployment (so file gets uploaded on Save).
Now debugging:
Considering your current scenario:
Overall I suggest zero-config approach -- will help with path mappings + no need to setup any Run/Debug Configurations.
Thanks very much.
Having a local copy and mapping it also to the deployment server is no problem.
I will go through this and will let you know my findings.
When setting up the project or at settings/languages/php you can set up the CLI Interpreter.
What's the reason for this? Is it enough to simply copy php on my local system and set the
php.exe in my setup? What advantage am I loosing here?
Thanks again!
>When setting up the project or at settings/languages/php you can set up the CLI Interpreter. What's the reason for this?
PHP Interpreter is needed if you wish to
>Is it enough to simply copy php on my local system and set the php.exe in my setup?
It depends on your OS -- please refer to php.net for instructions.
But generally speaking -- get PHP from windows.php.net and install needed VS dependencies (links available there as well) and it will run.
allright... I thought PHP is needed for the code checking within the IDE. Good to know, it's not.
The current status:
- I set up the files in my local machine
- I used deployment and path mapping to have the local changes published on my webserver. So when I save the file, it's updating the files on the server automatically. (In Tools/Deployment/Options I've tried the "always" option rather than "On explicit save action) but that made no difference at all).
- I have installed xdebug on the websverer as well as the debug booklets in my browser.
Right now the only thing missing is to make sure, that xdebug can reach PHPStorm via network. I'm working on that now.
>In Tools/Deployment/Options I've tried the "always" option rather than "On explicit save action) but that made no difference at all).
"Always" meant for automatic save cases (when IDE saves all unsaved files for you automatically: e.g. before running any Run/Debug Configuration, when accepting changes made in Settings screen, when executing terminal command and other cases).
"On explicit save" option for situations when you manually invoke "File | Save All" (Ctrl+S) -- should skip auto save events.