How to setup environment
Hello all,
I am looking for the best way to setup our environment and hopefully setup XDebug. Here's a description:
I'm running PhpStorm on a Windows machine. The checked out source code is on a Unix machine at /projects/testproject, and its mapped in Windows under Y:\testproject
When I run a build, the source files (and generated files) are copied to the Unix machine under /ccrun/htdocs/app/ which is where PHP is run from.
I have been just editing code directly out of Y:\testproject but I think editing on a network drive directly is not a good idea. There have been a number of times that I found the PhpStorm unresponsive if there had been a problem with the network drive, even if it the connection was restored. A few times I had to delete the .idea folder, otherwise the project wouldn't open again.
Thanks for any suggestions,
--Juan
Please sign in to leave a comment.
Juan,
Several useful links about Xdebug and PhpStorm:
http://blogs.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/
http://confluence.jetbrains.net/display/WI/Documentation
Thank you for feedback!
Hi Juan,
Unfortunately PhpStorm (and all other IDEA-based products) does not officially support such work-directly-over-network scenario (it works, but with such random lockups etc etc). IDEA platform requires fast access to project files and therefore you should go "Mounted Folder" way (where you will have your project locally on your Windows PC and on save all changed files will be copied directly to a Linux server over a shared folder).
1) File | New Project from Existing Files
2) Choose 2nd option -- "My web server is on remote host, files are accessible via network share or mounted drive"
3) Follow the rest steps of the wizard
4) When all done -- check "File | Settings | Deployment | Options" to make sure that "Upload changes files automatically to the default server" is selected (plus check all other settings)
Hi Andriy,
Thanks for the reply. I am not sure that setup will work for me though. I have a number of PHP/JS files that get generated by our build. If I create a local copy of my checked out source, I won't see my generated files under the project. Therefore, the IDE shows errors everywhere those classes are used. Plus I can't debug since those files aren't under the project. That's why I hadn't tried this setup yet, though I saw the option.
I thought I may just copy the generated files to my local project, but I'd need remember to do it everytime I change one of our configuration files.
Any suggestions?
Thanks
Thanks for the links, last time I tried to set it up I didn't see an option to map local files to files on the server, which was my problem, the files aren't in the exact same location in the source and the htdocs folder. Maybe this was added recently? Or maybe I just didn't look hard enough,
Thanks again,
--Juan
Hi Juan,
As to my knowledge this is the only option of what you can do in such situation as PhpStorm does not offer automatically-download-from-server synchronisation (but you may make it work with some 3rd party tools (like SyncBack, for example) which will sync any new/changed files from server to your PC -- at least it will be done automatically). No other ideas I'm afraid.
Then I think I'm better off editing the files directly on my mounted drive. I've found that as long as I shut down PhpStorm before I leave my computer, everything works well. I think the network drive gets disconnected after some inactivity and sometimes PhpStorm can't recover. The lesser of two evils, in my case, since I'd also have to worry about not overwriting the files I manually copied to windows.
Thanks again,
Juan,
This setting was introduced in 2.0.
Thank you for feedback!