IP에 대한 정보를 입력해야하는 XML 문서가 있습니다. 문제는 Apache에서 PHP로 XML을 구문 분석하는 것이 .htaccess
으로 수행 될 수 있지만 Azure로 이동하면 어려워졌습니다. 내가 시도하는 것 :web.config를 사용하여 PHP로 XML 구문 분석
의 Web.config
<?xml version="1.0"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".xml" mimeType="text/php" /> </staticContent> </system.webServer> </configuration>
을
<system.webServer> <staticContent> <mimeMap fileExtension=".xml" mimeType="text/php" /> </staticContent> </system.webServer>
htaccess로 applicationHost.config 파일
:AddType application/x-httpd-php .php .xml
그러나 이것의 아무 것도 작동하지 않습니다. XML이 정확하지 않으면 오류가 발생합니다. 도움이 필요하다. XML 파일 :
<config>
<settings ip="<?php /*getting external IP...*/ ?>" port="1010"/>
</config>
UPDATE 나는 헤더에서 확인해 보니 Content-Type
이 application/xml
것을 말한다.