How to integrate MAMP in Komodo IDE

I am considering getting Komodo IDE, but before doing that I need to figure out a few things.

I have been using Coda 2 for quite some time in combination with MAMP. MAMP enables me to preview all my work offline, which is a big benefit in terms of speed, testing and debugging.

I’d very much like to do the same thing with Komodo IDE. However, I haven’t been able to figure out how to do that. I couldn’t find any useful information in the documentation, in the forums or by googling. Some people have asked questions about MAMP in connection with debugging PHP, but that’s not my problem.

Any thoughts or suggestions would be much appreciated.

Best,
Franco

It should be as simple as configuring MAMP’s language interpreters under the Language preferences and configure the Environment variables MAMP uses (use printenv to see).

Not sure what you mean by “configuring MAMP’s language interpreters…”. Basically, MAMP is a MacOS application that enables me to run, among other things, an Apache server.
To preview my local files in Komodo all I would need to do is to remap their URL to "http://localhost:80/ … ".
I thought I could do the remapping in the Project preferences -> Mapped URIs, but that doesn’t seem to work.

Any thought?

Best,
Franco

I know what MAMP is, and it comes packaged with an interpreter for PHP. You have to configure Komodo to be pointed at that PHP interpreter that is in MAMP’s install directory.

Perhaps you could explain what parts you are still looking to configure, as it sounds like you have debugging working if you are working with mapped URIs.

I am not talking about PHP here, but javascript.

I tried to define a URI map, in my case from the project directory to http://localhost:80 as per Coda. If I enter http://localhost:80/index.html in the preview pane of Komodo, it does indeed preview my page correctly, but if I try to simply click on the preview button on the left the Komodo main window it doesn’t work. I tried many different variations, to no avail.

The preview button just previews the current file in your browser, it does not run javascript code. If you try to preview a javascript file it will just show you the contents of the javascript file just like it would in your browser.

If you want to run javascript code then you can use either the “Run Code In-Line” feature or Chrome Debugging, links to documentation for those features:

I setup a mapped URI for localhost for my XAMPP (cross platform version of MAMP) which points to htdoc (webroot of XAMPP) and when I click browser preview with a file from that folder (eg. C:\Users\me\path\to\htdoc) open I get the http://localhost/myfile.html. So it works. I’m guess you’re configuration for the Mapped URI wasn’t correct. It’s a very confusing dialog.

Here’s what my dialog looks like:

Hope that helps.

  • Carey

Hi Carey,

Thank you for your reply. That’s indeed what I am trying to do. Here is a screenshot of my URI Mapping:

My project files are contained in htdocs. If I try to preview the main index.html file, no mapping is taking place. But if I enter localhost manually in the address bar of the preview pane, then previewing works.

Is there anything else I need to add for this to work? I have no experience using Komodo IDE so perhaps I am missing something that is totally obvious to you but not familiar to me?

Perhaps it’s an issue with prefs. Set that Mapped URI globally, Komodo menu > Prefs > Mapped URIs.

Also, can you elaborate on the exact steps you use to preview your file? Perhaps there is an issue with your workflow or in how Komodo supports (or doesn’t support) that work flow.

There isn’t anything else you should need to do. All I did was start XAMPP, set the mapped URI, open an HTML file from htdocs then clicked the Globe icon that appears in the toolbar on the side of the Komodo UI.

  • Carey

Thanks Carey.

I made some progress. I installed XAMPP, copied the entire project in the htdocs directory there, set up the mapping for XAMPP and … this time it did work.

Now, it would be great if we could figure out why it doesn’t work in MAMP, as MAMP is a very well maintained application with a lot of options, far superior to XAMPP, in my opinion.

-Franco

Are you using different project files for MAMP and XAMPP? If so, could you share the project file for each?

Well, I can’t even tell you for sure, I have uninstalled XAMPP. In the meantime, I got in touch with MAMP tech support, so let see what they have to say.

I’ll also reinstall XAMPP and send you separate project files.

Best,
Franco

Ok here is the latest news:

  1. I did a clean install of both XAMPP and MAMP. Now I am no longer able to preview my files in either one of the two environments.
  2. The XAMPP version I installed yesterday was 7.1.6 but it turns out there is a more recent version 7.1.7, which is the one I installed today.
  3. Both local servers work fine. If I enter http://localhost in a separate browser when either one of them is running I get the desired result. So I guess the problem really is either with Komodo 10 or with me…

How can I send you the 2 project files? I don’t see an option for that in the browser.

-Franco

You’re able to preview both XAMPP and MAMP through browser preview if you manually enter the url right? So it’s just the mapping that’s broken?

I believe you should be able to zip up the project files and drag the zip onto the comment area. If not please just upload it to dropbox, google drive or similar.

Thanks!

Link to my dropbox:

It’s a 1.2 GB document, but all you really need is the index.html file at the top

I’m sorry, I wasn’t asking for your entire project - only the .komodoproject files. Sorry for the confusion.

Well, now you have everything:

Thanks. What about the XAMPP one?

1.2GB is a bit much to download :stuck_out_tongue:

Nothing really stands out as wrong in that project file, except maybe the live folder. I kinda doubt it’s related, but it’s worth a shot.

Try removing the live folder from your project and instead changing your project root to the htdocs folder (right click project > Preferences).

In addition, could you show a screenshot of your mapping preferences as well as of the browser preview popup that shows when you trigger it on a file that should be covered by the mapping?

I note in your MAMP project file that the mapped configuration has http://localhost:8888 which you had not mentioned anywhere else in this post. Is that correct? What exactly are you writing in the browser when it works? Every example you’ve given has only been http://localhost which is not the same.

  • Carey