Alex11 Posted April 19, 2023 Share Posted April 19, 2023 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."). Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/ Share on other sites More sharing options...
XCalibre3 Posted April 19, 2023 Share Posted April 19, 2023 I would assume you would change your .ini file to 8000 instead of the default 80? Have you given that a try? Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607489 Share on other sites More sharing options...
Alex11 Posted April 19, 2023 Author Share Posted April 19, 2023 I want to click in VS Code and receive result in port 80, not in 8000. I'm not sure, is this port defined in my PHP.INI or in something another place? Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607492 Share on other sites More sharing options...
requinix Posted April 19, 2023 Share Posted April 19, 2023 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? Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607496 Share on other sites More sharing options...
Alex11 Posted April 20, 2023 Author Share Posted April 20, 2023 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. Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607502 Share on other sites More sharing options...
Alex11 Posted April 20, 2023 Author Share Posted April 20, 2023 Hmmmm. Unfortunately this simple way don't working. I stop Apache, but permission to port 80 still denied . Why? Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607503 Share on other sites More sharing options...
XCalibre3 Posted April 20, 2023 Share Posted April 20, 2023 (edited) 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 April 20, 2023 by XCalibre3 Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607508 Share on other sites More sharing options...
Alex11 Posted April 20, 2023 Author Share Posted April 20, 2023 (edited) To @XCalibre3 My Goal is shutdown Apache and full uninstall it. And than start PHP DEVELOPER server on port 80 instead 8000 Edited April 20, 2023 by Alex11 Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607514 Share on other sites More sharing options...
kicken Posted April 20, 2023 Share Posted April 20, 2023 10 hours ago, Alex11 said: but permission to port 80 still denied . Why? Linux requires root for access to ports below 1024. Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607529 Share on other sites More sharing options...
XCalibre3 Posted April 20, 2023 Share Posted April 20, 2023 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. Quote Link to comment https://forums.phpfreaks.com/topic/316160-how-to-start-internal-php-server-on-port-80-instead-port-8000/#findComment-1607542 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.