2016-09-26 72 views
0

是否有任何可能訪問我的應用程序當前運行在虛擬框中的NetBeans上。由虛擬框中的netbeans創建的訪問本地主機

我的詳細情況是這樣的:由8080

  • 有依賴關係的應用程序同時運行在localhost-數據庫,Solr的...
  • 窗口虛擬機:

    1. 主機Ubuntu- NetBeans中打開本地主機虛框(對付IE)
    2. 有沒有什麼辦法來訪問:本地主機:從VB 8080,能夠測試應用(連接數據庫,Solr的...)還是在主機操作系統
  • 回答

    0

    https://netbeans.org/kb/docs/php/project-setup.html#runConfiguration

    指定新建項目

    運行配置的默認運行配置是用於運行PHP項目的存儲設置。您可以爲一個項目定義多個配置並在它們之間來回切換。例如,如果應用程序是在本地開發的並需要上傳到遠程生產服務器,則只需選擇另一個運行配置。運行配置適用於運行和調試。運行配置滿足以下常見的用例:

    Developing PHP web pages on a local machine with a local web server. 
    Executing PHP scripts using a local PHP engine. This approach is applied to PHP files that are not intended for outputting HTML. Therefore such scripts can be run without a browser. 
    Remote Development. The PHP source code and other application files are uploaded to a remote web server via FTP. This use case is common when the development is shared across multiple people. 
    A combination of the above use cases: an application is developed locally and deployed on a remote production server upon completion. During development, PHP scripts are executed if necessary. 
    

    當你創建一個新的PHP項目,創建項目的默認運行配置。要設置項目的默認運行配置,請從「運行配置」面板的「運行方式」下拉列表中選擇相關選項。下列選項:運行配置:

    Local Web Site. To use this run configuration, you need the Apache http server installed and running. 
    Remote Web Site (FTP/SFTP) (Separate tutorial). To use this configuration, you need a hosting account on a remote server and an FTP account on this server. 
    Script. This run configuration does not require that a web server be installed and running. You only need a PHP engine. 
    

    創建其他運行配置,或編輯默認運行配置的過程中,自定義項目設置描述。除了使用現有項目的「屬性」對話框而不是新建項目嚮導之外,它與創建默認運行配置的過程幾乎完全相同。 本地網站

    本地網站配置涉及您的機器上安裝的Apache Web服務器的Web文件夾中的PHP源文件夾副本。一個項目同時擁有本地和遠程網站配置是常見做法。請注意,設置本地網站運行配置的過程略有不同,具體取決於您是從現有源創建項目還是不使用現有源。

    要建立一個本地網站配置:

    From the Run As dropdown list, choose Local Web Site. 
    In the Project URL field, check the automatically generated URL address. Make sure that the Apache HTTP server listens to the default port 80. If not, specify the port number explicitly, in the format localhost:<port number>. 
    Project Run Configuration: Local Web Server 
    If you are creating the project from existing sources, you can choose which source file to use as the index file. 
    To store the project's source files in a different directory than the NetBeans IDE project, select "Copy files from Sources Folder to another location". If you are creating a project from existing sources, this is a required step, unless the existing sources were already in the web folder of your Apache server. 
    The field by default specifies the following path: <Document Root>\<New PHP Project>. Use the Browse button to specify a different path, if necessary. 
    The document root is the folder where the web server looks for files to open in the browser. The document root is specified in the web server configuration file. 
    The wizard detects the Apache installation type, either a component or within a package, and provides the path to the default location of the htdocs folder for the current installation type. Therefore, if you accepted the default settings during the installation of the Apache server or the AMP package, choose the path from the dropdown list. 
    Click Finish. The IDE creates your PHP project. 
    

    遠程Web站點

    參見教程部署PHP應用到遠程Web服務器。 腳本

    From the Run As dropdown list, choose Script. 
    Project Properties dialog showing Run Configuration properties, with Run As...Script selected 
    To specify the location of the PHP engine, click the Configure button next to the Use Default PHP Interpreter box. The PHP Options dialog opens on the General tab. 
    Project Run Configuration: Script. Specifying the path to the PHP engine and the output location 
    In the PHP 5 Interpreter field, specify the path to the php.exe file. Use the Browse or Search... button, if necessary. 
    To specify how the script execution results will be shown, select the relevant checkbox in the Open Result In area. The following options are available: 
    
        Output Window. The results of executing a script will appear in the output window in the bottom of the NetBeans IDE window. 
        Web Browser. The default browser window will open with the results of executing a script in the form of an HTML file. 
        Editor. The results of executing a script will open as an HTML file in the IDE editor window. 
    Click OK. The Options dialog box closes and the system returns to the Run Configuration panel. 
    Add any arguments, such as debug=true, and any PHP command-line options. 
    

    自定義項目設置

    在項目創建的基本項目設置中定義:項目類型,項目源文件的位置,默認運行配置。要用新設置擴展項目設置,請自定義項目。將光標置於項目節點上,然後從彈出菜單中選擇「屬性」。 「項目屬性」面板打開並顯示設置類別列表。 源頭

    在源頭面板:

    The Web Root field shows the root folder of your application site. By default, the field shows the Sources folder. To change the web root, click Browse and select another folder. 
    Select the Copy files from Sources Folder to another location, if necessary, and specify the path to the storage folder. 
    Change the encoding, if necessary 
    Managing project setup: Project Properties dialog box 
    To complete the project customization, click OK. 
    

    運行配置

    在運行配置面板,修改默認運行配置和/或如果必要定義新的運行配置。

    To modify the default settings, update the fields as during the project creation. 
    To define a new run configuration, click New next to the Configuration dropdown list. The Create New Configuration dialog box opens. 
    In the Configuration Name field, enter the name of the new run configuration and click OK. You return to the Run Configuration panel. 
    Define the run configuration settings in the same way as you defined the default run configuration during the project creation and click OK. The new configuration is added to the Configuration dropdown list. 
    To remove a configuration, select it from the Configuration dropdown list and click Delete. 
    Managing project setup: Run configuration 
    To complete the project customization, click OK.