簡體   English   中英

將PHP代碼放在Glassfish docroot文件夾中

[英]Putting PHP code in the Glassfish docroot folder

以前我使用共享主機,托管公司為Apache Tomcat提供PHP和MySQL。 我已經切換到使用Linux的虛擬專用服務器托管,因此我可以使用我選擇的服務器,特別是用於Java ServerFaces 2.2應用程序的Glassfish 4.1.1,並且已經為特定應用程序部署了war文件。

但是,我有很多舊代碼,包括一些PHP。 我把我的舊代碼放在Glassfish的docroot文件夾中,所有直接的HTML5,JavaScript等都沒有任何問題。 如何使PHP代碼像以前一樣工作? 在進行Google搜索時,似乎可以從Quercus部署war文件,但如果這樣做,我如何讓PHP在docroot文件夾中工作?

我之前沒有發現任何人,所以任何建議都會受到最高的贊賞 - 提前謝謝。

我之前使用過GlassFish和JSP。 現在PHP已經成為我選擇的語言。 我覺得它更易於維護。

但要回答您的問題,為了讓PHP在docroot服務器上運行,您必須在OracleGlassFish Server上啟用PHP。 來自Oracle文檔

1. Download the Quercus PHP interpreter from http://quercus.caucho.com/.

2. Deploy the downloaded WAR file to the GlassFish Server.

3. To verify that your PHP engine is working, enter the following URL in your browser: 
http://localhost:8080/quercus-4.0.1/

4. Move your PHP application to a subdirectory of the Quercus directory.

5. To verify your PHP application is working, access your application from a browser.
For example, enter the following URL in your browser:
http://localhost:8080/quercus-4.0.1/myapp/

此外,SO的先前答案也可能有所幫助: 允許Glassfish和PHP在使用Apache的同一服務器中協同工作

暫無
暫無

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

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