简体   繁体   中英

visual studio does not recognize php

i added php code in my cshtml view under asp.net mvc.

<body>
<?php echo"hello";?>
...

however it seems that vs does not understand that it's php and when I inspect element, the php code was automatically commented out.

<!--?php echo"hello";?-->

how can I solve this? I have already installed php tool extension in vs.

To run php script, you need to have .php files, or it won't be recognized. To enable the script to be recognized as php without changing file suffix, add config files depending on the server you are using. (most likely Apache/IIS)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM