簡體   English   中英

Apache AddHandler:將ASP代碼作為PHP運行

[英]Apache AddHandler: Run ASP code as PHP

我正在運行XAMPP。

是否可以添加一行到.htaccess或http.conf中,以使ASP被解析並作為PHP頁面處理?

我之前安裝過它,但不記得該怎么做。 到目前為止,我沒有嘗試過。

編輯:這些解決方案都不起作用,我已經嘗試了一切。

如果上述解決方案都不適合,請使用phpinfo()檢查服務器API。 方法。

如果Server API是CGI或FAST CGI,則將其更改為Apache 2.0 Handler。您可以使用Plesk Panel或CPanel進行操作。

另一個選擇是不更改Server API,而是更改.htaccess或httpd.conf: http : //avinashsing.sunkur.com/2012/04/19/how-to-map-another-file-extension-to-the-php- parser-through-htaccess /

但是我已經解決了第一個問題。

也許試試這個:

AddHandler php5-script  .php .asp .aspx .ascx .ashx .asmx
AddType text/html .php .asp .aspx .ascx .ashx .asmx

嘗試將此行添加到.htaccess;

AddHandler application/x-httpd-php .asp

顯然,它不如向http.conf中添加等效項有效,但即使您無權訪問http.conf,它也可以工作。

.htaccess添加此行使我能夠執行用.asp頁編寫的PHP代碼:

AddHandler php5-script .php .asp

將此添加到您的httpd.conf

AddType application/x-httpd-php .asp .aspx .ascx .ashx

Apache沒有用於ASP處理的模塊。 您必須為此使用IIS。 現代IIS可以運行PHP,因此您可以反過來使用IIS,然后將IIS插入PHP。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM