1

I am using NetBeans IDE 8.0.1 for my PHP development.

I like the syntax check feature in netbeans. But the problem that I have is that it only works with files that have .php extension .

I am using a lot of php code in files with .html extension, and no php syntax checking is being available in NetBeans for those files.

Is it possible to enable php syntax checking for .html files?

2 Answers 2

3

One hacky way to do that:

  • go to Tools|Options|Miscellanous
  • select Files tab
  • from File extensions, select HTML
  • from Associated MIME type, select text/x-php5

Then NetBeans will consider all HTML files as PHP ones

Sign up to request clarification or add additional context in comments.

1 Comment

Nice stuff! Thanks a lot
0

Well if your files have .html extension then it will never be able to execute the php code and to execute php code the extension must be .php as PHP stands for Hypertext Pre-processor so it is processed before HTML.

2 Comments

If you are using any frameworks then you should install its plugin for syntax checking.
extension doesn't need to be php. You can run it from console use include/require and change default server configuration and it will start working.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.