Jump to content

How to start internal PHP server on port 80 instead port 8000


Alex11

Recommended Posts

I'm novice in PHP and can working only with VS Code debugger. Unfortunately my current project can not working with port number, it can working only as http://localhost/folder-name and can not working as http://localhost:8000/folder-name

I don't know how to force embedded PHP server working with port 80 (in order to use PHP extension for VS Code - "All-in-One PHP support - IntelliSense, Debug, Formatter, Code Lenses, Code Fixes, Linting, Refactoring, PHPUnit Tests, Web Server, and more.").

Link to comment
Share on other sites

You need to alter your run configuration in VS Code to pass the -S argument to php.exe. That customizes where it listens on. You'll want "-S localhost:80".

 

2 hours ago, Alex11 said:

Unfortunately my current project can not working with port number,

It really shouldn't matter. Why does it not work?

Link to comment
Share on other sites

Ups, Thank you, I understand place to insert 80. This is launch.json.


 

    "configurations": [

        {

            "name": "Launch built-in server and debug",

            "type": "php",

            "request": "launch",

            "runtimeArgs": [

                "-S",

                "localhost:80",

                "-t",

                "."

            ],

            "port": 9003,

            "serverReadyAction": {

                "action": "openExternally"

            },

            "runtimeExecutable": "D:\\PhpCli7\\php.exe"

        },

 

"Why does it not work?", I don't know, I'm newbie, and Author of my program said me that start his program impossible on another port than 80.

Link to comment
Share on other sites

2 hours ago, Alex11 said:

Hmmmm. Unfortunately this simple way don't working. I stop Apache, but permission to port 80 still denied . Why?

 

In your Apache Httpd.conf file, there is a place to set this.  I'm new to much of this, but since you mentioned it.

Fine

# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 152.37.156.203:1000
Listen 80

and probably change that to 8000.  Just trying to help solve the issue; by no means a professional at this... especially since I don't work with VB.  Just change that info; stop Apache and then restart. Good luck.

Edited by XCalibre3
Link to comment
Share on other sites

10 hours ago, Alex11 said:

To @XCalibre3 My Goal is shutdown Apache and full uninstall it. And than start PHP DEVELOPER server on port 80 instead 8000

In my experience with PHP and APACHE, if you want port changes, they are in the ini files that are in the Apache php.ini.  I could be way off as I have never dealt with what you are trying to setup, so I hope it helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.