Simple Question Follow
I am a long time user of IntelliJ and wanted to learn PHP. So I jumped at the chance to get WebStorm.
System: MAC OSX
Using MAMP - PHP and Apache
How do I automatically upload changed files from from Webstorm project directory to my local file system Apache document root. I clicked the automatically transfer files to server checkbox to on. But when I try to run, the File Transfer window displays: Cannot transfer file to Apache server. If I manually copy the php file from the project directory to the document root I can run it from Run button in Safari.
I want to use the local file system to move files from a project folder to the Apache document root folder.
In DREAMWEAVER there is a clear distinction between source files (Projects) and Server and using the local file system as the mode of transport. Just not making the connection with the WebStorm Configurations IDE.
Please sign in to leave a comment.
Hi Jim. Open PhpStorm Settings and follow arrows on the screenshot:
If I understand you right, you have Apache installed locally, but Project folder is located outside Apache web root, so that you have to copy the files before you can retrieve the pages from the server.
In this case you need to add server with 'Mounted folder' access type (File | Settings | Deployment). Typically, this type of server is used when you have web server set up remotely and mount it's filesystem to some local folder, but PhpStorm does not care if 'Mounted folder' you specify is real mount, or is just plain local folder.
Then you have to set up mappings ('Mappings' tab): simply saying, the association between your project root, it's location on server, and web path (tail of the URL) to it.
In case project is located under Apache web root, so files are picked up right from place, you need to add 'Local' server and specify just a web path, as Dmitriy kindly illustrated above.
And Thank You Dmitriy and Kirill! Yes I have Apache, PHPStorm and MySQL all installed on a single MacBook Air. Just wanted to create a simple development environment to experiment with. I was thrown off by the Remote Mount option. I assumed that meant an Apache Web Server on another networked machine. I assumed local meant 'LOCAL' to the system you are on. I changed the setting to Remote Mount Folder and was running in no time! Thanks. I am a long time Java WebServer programmer and Intellij user. So I was very comfortable with the interface. A couple of humble observations.
1) I do not typically place my my project files in the target directories for the output. In Java I have a directory for Java projects to store and then deploy them to either a webserver or a Execute directory for standalone JAVA projects. I do not want Inellij artifact files like .ipr and .ipw being deployed to the server. I took this approach with Storm right away. I do notice there does not seem to be any artifact files in the Storm project directories? I was able to create new folders in the project and add PHP code to them and Storm correctly created the file and folder in the Apache document root. Is there a way to instruct the Deploy function to omit certain file types when it deploys?
2) Does Storm have its own PHP engine? Or does it depend on a PHP installation? I am still trying to figure out the whole execute/debug concept for Storm.
3) What is Xdebug? This question relatates to 2.
Storm 1.0.1 (Personel License)
Thanks for Your Help and your great Feedback!
Thank you for your feedback,
We will fix this confusion in the next version.
You can modify 'Exclude items by name' option at File | Settings | Deployment | Options pane. By default '.idea' pattern is there, so IDEA project folder will be ignored.
PhpStorm analyzes PHP syntax on it's own, but to execute PHP page it needs either PHP installation ('PHP console' run configuration), or web server with PHP installed.
PHP installation (File | Settings | PHP) can have a set of 'Include paths' - equivalent to Java classpath - these directories are checked by PHP interpreter when it resolves the included file (see details). So, when you specify your PHP home, PhpStorm will detect this setting and include these directories in the index, so that resolve and completion works for elements defined in these files. Still you can customize this set of paths yourself.
Xdebug is a PHP installation addon that allows to debug PHP execution. MAMP should probably have it included, but it might be disabled. Keep 'Validate Xdebug configuration before debug' checkbox selected @ your PHP run configuration page, and PhpStorm will try to check if Xdebug is installed and configured properly.