You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Bruce Button <br...@imago-web.co.za> on 2021/06/14 19:57:20 UTC

[PHP] NetBeans not recognizing virtual server on WAMP

Greetings!

I would be most grateful for some help on what
        seems to be a simple problem — though I have searched
        unsuccessfully for the solution.

I am using Windows 10 with WAMP, and have
        created a virtual host for a NetBeans PHP project. The url for
        the virtual host is 
<http://mphp>
http://mphp. The virtual host allows the
        project to be accessed as the main folder of the url, rather
        than as a subfolder, as would be the case if I put the files
        into a subfolder of WAMP's www folder.
In the project Run Configuration I have
        entered 
<http://mphp>
"http://mphp" as the project url, but when I try to
        launch the project from NetBeans the virtual host is changed to
        "localhost". Similarly, if my project is accessible in a
        subfolder of localhost, and I enter "localhost/subfolder" in the
        Run Configuration, NetBeans changes that to just "localhost".

I have Googled, looked in the NetBeans
        documentation and everywhere else I can think of for answer, but
        can't seem to find it.
Any help would be most appreciated.
Thank you!
Bruce Button
—————
Configuration: Windows 10 Professional, 64-bit

        WAMP 3.2.4 - 64 bit

        NetBeans IDE 12.0

Re: [PHP] NetBeans not recognizing virtual server on WAMP

Posted by John Lavelle <jo...@jql.co.uk>.
Bruce,

Have you done the following?:

   1. added the url (mphp) to your HOSTS file (127.0.0.1 mphp)
   2. uncommented the line: # Include etc/extra/https-vhosts.conf in
   http.conf
   3. created a document root in httpd-vhosts.conf
   4. Restarted Apache2

If so *and* they are correct then, in NetBeans→Project properties→Sources:

Project folder: "path to your project root" (probably C:\WAMPP\htdocs\mphp)
Sources folder: "path to your project root" (probably C:\WAMPP\htdocs\mphp)
Web Root: <source Folder>


in NetBeans→Project properties→Run Configuration:

Run As: Local Web Site (running on local web server)

Project URL: http://mphp/
Index File: index.php


Best regards,
John
john@jql.co.uk
JLavelle.uk https://www.youtube.com/jlavelleuk
Bike Farkles: https://www.youtube.com/channel/UCPRV92Cf_R1ihviRtVU2teQ



On Mon, Jun 14, 2021 at 9:57 PM Bruce Button <br...@imago-web.co.za> wrote:

> Greetings!
>
> I would be most grateful for some help on what seems to be a simple
> problem — though I have searched unsuccessfully for the solution.
>
> I am using Windows 10 with WAMP, and have created a virtual host for a
> NetBeans PHP project. The url for the virtual host is http://mphp. The
> virtual host allows the project to be accessed as the main folder of the
> url, rather than as a subfolder, as would be the case if I put the files
> into a subfolder of WAMP's www folder.
>
> In the project Run Configuration I have entered "http://mphp"
> <http://mphp> as the project url, but when I try to launch the project
> from NetBeans the virtual host is changed to "localhost". Similarly, if my
> project is accessible in a subfolder of localhost, and I enter
> "localhost/subfolder" in the Run Configuration, NetBeans changes that to
> just "localhost".
>
> I have Googled, looked in the NetBeans documentation and everywhere else I
> can think of for answer, but can't seem to find it.
>
> Any help would be most appreciated.
>
> Thank you!
>
> Bruce Button
>
> —————
>
> Configuration: Windows 10 Professional, 64-bit
> WAMP 3.2.4 - 64 bit
> NetBeans IDE 12.0
>