Search code examples
phpphpstormxdebug

PhpStorm runs only JavaScript instead of PHP?


I have just installed fresh PhpStorm on Mac. I set my interpreter and so on. I can create .php files. But when I run it runs only JavaScript and there is no option to run php? How can I fix this?

Run 'filename.php (JavaScript...)'

Same with debug. How this can be fixed?


Solution

  • It seems you've configured PhpStorm to handle files with .php extension as JavaScript code rather than PHP.

    Open the settings dialog (File/ Settings), head to Editor/ File Types and review the Recognized File Types section:

    • Remove *.php from JavaScript.
    • Make sure that PHP contains *.php.
    • Remove any other unwanted registered pattern, such as filename.php.