05 March 2012

How to Configure PHPStorm to Open Php Files in Your Browser in Localhost

How do you get PHPStorm to show your PHP files in your browser by clicking on the little browser icons in the right part of the window or right clicking and opening in your browser. PHPStorm doesn't just do this automatically. You have to configure it, and the configuration is entirely obvious. Here's what you have to do.

I'm assuming you have XAMPP or its equivalent installed and running on your machine. I'm also assuming you dumped your php files in the htdocs directory of XAMPP and that you can view your files in your browser just by typing the address using localhost/yourfile.php. And now you want to be able to open your files from within PHPStorm.


Here's what you do: 
1) go to the file > settings > deployment tab.
2) click default, and name it add Default to the name.
3) In the connection tag make it "In place".
4) Set the "Web server root URL" to http://localhost


5) go to the "Mappings" tab.
6) set the "Local path" to C:\xampp\htdocs\your_folder .
7) set the "web path on server "Default" to /your_folder/ .





Test to see if your file will now open in your browser. If not follow the instructions again. Notice if you start a project with a new directory under htdocs you will have to tell PHPStorm about this. To do so follow the steps again and in steps 6 and 7 above you will have to change the path to the location of your new subfolder of htdocs. This solution is just for Windows. Perhaps I will post a version for OS X if there's interest.


9 comments:

Anonymous said...

Very useful, thank you!

Anonymous said...

Hi

Thanks a lot for this post. I was stuck as to how to get phpStorm to communicate with localhost. Your article helped me immensely.

Thanks again

Richard C. Lambert said...

I have been searching to find a comfort or effective procedure to complete this process and I think this is the most suitable way to do it effectively.
dog liver detox

priya said...


This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
Data Science Tutorial
Data Science training in anna nagar
Data science training in jaya nagar
Data science training in pune
Data Science Training in Marathahalli
Data science training in kalyan nagar


nisha said...

Good Post. the post really very Impressive. concepts are explained very neatly.
Data Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery


praveen said...

Hi,Great information.Thanks for sharing.I always read your blog and get lot of useful information.
oracle training in chennai

oracle training in porur

oracle dba training in chennai

oracle dba training in porur

ccna training in chennai

ccna training in porur

seo training in chennai

seo training in porur

Jayalakshmi said...

You have done a good research on this topic.
Great Work. Thanks for sharing this blog,
hadoop training in chennai

hadoop training in tambaram

salesforce training in chennai

salesforce training in tambaram

c and c plus plus course in chennai

c and c plus plus course in tambaram

machine learning training in chennai

machine learning training in tambaram

shiny said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts.


hadoop training in chennai

hadoop training in annanagar

salesforce training in chennai

salesforce training in annanagar

c and c plus plus course in chennai

c and c plus plus course in annanagar

machine learning training in chennai

machine learning training in annanagar

Crackjin said...

Wow.. Very informative article thanks for sharing please keep it up because there is no limit of information so I'm waiting for an awesome article just like that.
Crackjin
IDM Crack
TeamViewer Crack
PhpStorm Crack
Tenorshare iCareFone Crack