Atom editor, open php script in localhost (Test in Browse)

Asked

Viewed 995 times

0

In Netbeans by clicking |> (play) I run my php project on localhost. Now I’m testing the Atom editor and wanted to know if there is a plugin / extension that enables this function. Open html files in Browse, I already got it, but run "index.php" I’m not getting it.

  • I don’t think so... But you can use WAMP Server and always open your PHP files: http://www.wampserver.com/en/

  • Thank you @Thiagosantos but it’s all working in Netbeans, I just wanted to test the Atom Editor. Inclusive already installed this package "https://atom.io/packages/open-in-browser" and works with HTML files, but when you need to run the PHP script on the localhost, it is not useful.

1 answer

1

Carlos, you can open HTML because it is interpreted by any Browser. However, PHP requires you to install a PHP server. In the past what was usually installed was apache2, but today with PHP 7 you can run the command from CMD or terminal:

php -S localhost:8000 -t seudiretorio/index.php

Probably Netbeans has some built-in PHP server, so it works. I hope I’ve helped.

  • It is worth adding that Atom has a terminal plugin: https://atom.io/packages/terminal-plus

  • @Nataniel Paiva / Juniornunes Maybe I expressed myself badly when I asked the question, but my system is working well on the localhost, and also on the web-based online server, there is no built-in Netbeans server, so it’s not that problem, but just add the project run feature (in the Atom editor), which natively already has in netbeans. I will test the given plugin.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.