From the course: PHP: Choosing a PHP Editor

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Running PHP files from a text editor

Running PHP files from a text editor - PHP Tutorial

From the course: PHP: Choosing a PHP Editor

Start my 1-month free trial

Running PHP files from a text editor

- [Instructor] I'm now going to show you how to run a PHP script using Notepad++. If you have a PHP script, you can run it from the terminal like this, and Notepad++ has this handy feature. So we can actually right-click on it and open in CMD, and we can type php, and then the name of the file. This is assuming php is in your path, and you can see you got your output in your terminal. So that's one way we can do it. We can also assign a keyboard shortcut for doing this, and use this Run option in the menu. So Run. I can paste in a command and then Run, but I can also assign this to a particular key combination. So that's very useful. Command itself. Just to show you what it looked like was this. So I was using this variable's CURRENT_DIRECTORY, and full name to execute a command from CMD. and full name to execute a command from CMD. Obviously, this is Windows based. We can also use PHP's built in server, like this.…

Contents