PHP validation on Go code

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cannot validate since a PHP installation could not be found. Use the setting ‘php.validate.executablePath’ to configure the PHP executable.

On Go files.

Steps to Reproduce

Open a .go file that contains a Go code. Save it to trigger the validation. Cursor things that the code is PHP and tries to find a PHP installation.

Expected Behavior

Not to trigger any PHP validation at all!!!

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.4.5
VSCode Version: 1.99.3
Commit: af58d92614edb1f72bdd756615d131bf8dfa5290
Date: 2025-08-13T02:08:56.371Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.12.11-100.fc40.x86_64

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This looks like a file association issue: Cursor is mistakenly detecting your Go files as PHP.

First, check the file extension, make sure your Go files are saved with the .go extension.

If that’s not it, fix the language mode:

  1. Open the Go file
  2. Check the bottom-right of the editor, it should say “Go”
  3. If it says “PHP,” click it and select “Go” from the language list

Also check file associations in Settings → Text Editor → Files → Associations and ensure *.go is mapped to the go language.

If it keeps happening, the file content may be confusing auto-detection. The detector looks at content patterns, so PHP-like syntax or top-of-file comments in your Go files can trigger it.

Let me know if the language mode shows “Go” but you still get PHP validation errors.

Also, please try updating to the latest version of Cursor.

Hello @deanrie , Thanks for the response.. My files are already marked as Go.The settings are all fine.

Still cursor is trying to validate my Go files as PHP. There is NO anything that indicates that the file is or looks like a PHP code (this is impossible in Go).

Do you have the PHP and Go extensions installed? I also think the issue might be caused by incorrect settings.

I don’t have any PHP extensions installed. Not even PHP is installed in my environment.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.