I've tried all I could found here and googling. Include paths, external libraries, interpreter settings...
Whenever I try to run my theme's index.php
file:
C:\XAMPP\php\php.exe "C:\path\to\project\wp-content\themes\MYTHEME\index.php"
Fatal error: Call to undefined function get_header() in C:\path\to\project\wp-content\themes\MYTHEME\index.php on line 1
Process finished with exit code 255
So yes on line 1 I'm just calling my header.
Turns out it's trying to run index.php
like a standalone file, but ignoring the whole Wordpress instalation (that I have included from different angles). Certainly it nows where get_header()
is because I can control click it and it'll bring me to the file it's declared in, no problems.
It correctly detects XAMP's PHP interpreter too.
It also works well if I just visit the site typing my localhost URL in the browser. It just won't work through Phpstorm.