Missing "Running as ... PHP script" in Eclipse

I recently installed Eclipse 4.2 (Juno) + PDT 3.1.1, and I chose the PHP perspective. I created an empty project "Project Project Project" and added the file "test.php" to it. Now I want to run this file as PHP Script. But I just don't have it in my "Run as ..." context menu when I right-click on the test.php file. Please help. I'm exhausted.

Additional Information:

  • I have php5 installed on my PC and I can run .php files on a windows command prompt using the php syntax filename.php.

  • I tried the same thing in the so-called Eclipse + PDT All-in-one package. Same problem.

+6
source share
2 answers

Go to "Settings"> "PHP"> "Debugging", check the box "Enable CLI debugging".

+8
source

You do not need to "run" your PHP files through Eclipse (or any IDE, for that matter). You can also easily debug by temporarily printing out the values โ€‹โ€‹of the variables that you are trying to check on the page. Just open your browser and browse to the file (for example: localhost / [page]? [Querystring]).

Remember that PHP is an interpreted language, not a compiled language (for example, Java or C #), so you do not need to โ€œrunโ€ it from anywhere to a specific one. While your server is configured to process php files, you can view them through a browser.

Use the IDE for its code completion and development acceleration functions (as opposed to using the bare-bones text editor). Test in the browser.

-2
source

Source: https://habr.com/ru/post/921701/


All Articles