PHPStorm seems to be treating php.ini as a script
Hi,
I'm playing with PHPStorm for the first time, using the php.ini-development config file, that comes with the 5.x download.
When I try to run anything, it interprets an 'and' inside comments as code:
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off
, and returns an error
Parse error: syntax error, unexpected 'and' (T_LOGICAL_AND) in C:\Php_05\php.ini on line 193
PHP Parse error: syntax error, unexpected 'and' (T_LOGICAL_AND) in C:\Php_05\php.ini on line 193
Is there a better default copy of php.ini available, that PHPStorm will interpret correctly?
请先登录再写评论。
Hi Dwayne,
Why does the interpreter consider php.ini as a PHP file - that's the question.
Do you include this file into your code?
Please provide us with a code sample.
No. But the Run settings require a configuration file, and that is php.ini. The same file is specified in Settings/Languages & Frameworks/PHP/Interpreter.
Here is the code:
whatthe.php:
Dwayne,
Ah, I see now. You have selected the INI file in 'Run/Debug Configurations | PHP Script | Configuration | File' right?
Please select the PHP file instad, the php.ini is only needed for initial interpreter configuration.
Understood, thanks Eugene.