2

It is my first time touching on php and I'm learning the basics of it. I've used Notepad++ for all of my HTML, CSS, and javascript files. Since, theses three are able to test and run locally, php isnt because it's a server side which requires a server to run. I was wondering, if there's a way to make Notepad++ run the file on the server?

In the Notepadd++ title header, it gives the local directory "C:\Users\Jaime\Desktop\grade.php" of my file, but can this directory be altered to something like "http://" indicating it's being tested and run on the internet?

If not, is there anything else I can use to efficiently run php files without having to refresh and put the files in Filezilla to see the changes made?

Thanks!

3

4 Answers 4

6

These answers so far deal with either running PHP locally or synchronizing with a server (which it seems like you were already doing), but none seem to address actually executing the PHP script from Notepad++, which I think was your main question. I'm not an expert on Notepad++ by any means, but here's what I came up with:

  1. Go to Run -> Run...
  2. Type in firefox "http://yourserver.com/$(FILE_NAME)"
  3. Hit "Save..."
  4. Type in a name like "Run on Server"
  5. Pick a keyboard shortcut
  6. Hit OK, then Cancel

Replace "yourserver.com" with the URL to your web server. This shortcut should launch Firefox and point it at http://yourserver.com/YourCurrentFile.php, assuming the file you were editing was something like C:\Users\TheAmazingKnight\Desktop\PHP\YourCurrentFile.php. It's not a perfect solution, but you should be able to tweak it to your needs.

2

What you probably need is an FTP Synchronize plugin that will allow you to edit a copy of your php file and then synchronize it to the server.

How to Install:

  1. Make sure that your Notepad++ is closed

  2. Download from this link . I choose version 0.9.6.1. Unpack or Unzip to \Notepad++\plugin folder.

  3. It will have its own folder so copy or cut and paste the files to \Notepad++\plugin

  4. Read the file named "What file to use" so that you will know which to use. In my case I used FTP_synchronize.dll

  5. Run your Notepad++ and it will tell you that it will remove the unwanted files and just click Ok for it.

  6. Go to Plugin-->FTP Synchronize-->Show FTP Folders. And presto there you have it!

How to Connect:

Go to menu Plugins-->FTP Synchronize-->Show FTP Folders

Go to Menu Plugin

Click Open Settings Dialog

enter image description here

Click the New Button then type-in the Address, Port, Username, Password and check Active on Connection Mode. And finally Click OK.

enter image description here

Click Connect

enter image description here

Click upload Current File to Folder

enter image description here

Then check your website and in my case the files uploaded are on the login name that I used that turned into a folder. And inside the folder are the files that I uploaded. Or of course you could really go directly to the wwwroot folder (or whatever folder name for your root) if you like so that you don't have to transfer the files.

1
  • How do I use it because the link you provided isn't clear enough on how to install and begin using it right away. Nov 12, 2013 at 4:55
0

Have a look at WAMP Server - it's easy to install and easy to use.

0

You could install the XAMPP server in your machine.

The server will run in a directory you choose, and you will be able to run PHP files from your browser in the http://localhost address.

You find XAMPP here: http://www.apachefriends.org/en/xampp.html

4
  • I have no idea how to use XAMPP. I downloaded it but have no idea where to begin. How do I set it up and make changes on the server with the files on there using XAMPP? Nov 12, 2013 at 4:59
  • It is easy to use. You can find more information here and here. You can also search for more tutorials. Nov 12, 2013 at 6:09
  • Thanks Diego! I'm a step closer to making it work. When I run Apache and put in localhost in the firefox browser, it just shows a blank page, nothing is being displayed like it should show XAMPP's website. I tried the same with Filezilla, same results, any idea why this occurred? Nov 12, 2013 at 20:58
  • When you configure the XAMPP correctly, http://localhost should point to your htdocs XAMPP directory. In this directory you can find a index.html, that is the page that should be displayed. You can put other files in this directory (usually C:\xampp\htdocs) and point to them in the browser. Example http://localhost/newpage.html. Nov 13, 2013 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.