0

Installed EasyPHP Devserver on Windows 7.

EasyPHP Devserver Version 17.0 (pretty the latest)

EasyPHP Devserver Apache Version 2.4.25

You may skip direct to my conclusion below.

Here is my process of trials.

In the httpd.conf file, I added the second Listen port

Listen 127.0.0.1:80
Listen 127.0.0.1:8080

Then at the EasyPHP Devserver website console (http://127.0.0.1:1111) I restart the Apache. the httpd.conf file will be rewritten to the following, and Apache cannot start. (Where can I see the error log? Nothing written into EasyPHP Devserver\eds-binaries\httpserver\apache...\logs)

Listen 127.0.0.1:80
Listen 127.0.0.1:80

If I leave the httpd.conf file with only one Listen port

Listen 127.0.0.1:8080

Apache starts successful, but httpd.conf is also rewritten back to

Listen 127.0.0.1:80

And in the EasyPHP Devserver website console (http://127.0.0.1:1111) > Http Server Settings (the gear icon) > there is a drop down menu for us to select the Port: 80.

There are a few options, 80 8080, 8000, 8888, 8008. If I change here, and restart the Apache. the httpd.conf is updated according to this setting.

Conclusion

My conclusion is, no matter what I set in the httpd.conf file, the Listen 127.0.0.1:80 will be rewritten by the setting in the EasyPHP Devserver website console > Http Server Settings > Port. The real setting is controlled by the EasyPHP Devserver website console. The httpd.conf file Listen directive is not functionable.

Question

Here comes the question. In fact I only wish to configure Apache Listens to multiple port, 80 for production and 8080 for development. How can I do it?

midnite
  • 5,157
  • 7
  • 38
  • 52
  • I wonder should EasyPHP questions goes into stackoverflow? I guess serverfault might be more appropriate, but serverfault even lack the EasyPHP tag. And how about superuser? In superuser, there is EasyPHP tag but no EasyPHP-Devserver tag. Hmm... I think I will just leave this in stackoverflow. Should you have better suggestions, please kindly let me know. Thanks. – midnite May 14 '20 at 09:32
  • https://stackoverflow.com/questions/51688508/changing-port-number-in-easyphp-devserver-17 Similar question here. But I still lack a method to make port setting multiple. I guess this might be the crap of EasyPHP ... :( – midnite May 14 '20 at 09:37

2 Answers2

0

Nice. I find out a Brute-Force solution.

In EasyPHP-Devserver-17\eds-binaries\httpserver\apache...\eds-app-actions.php line 97, it is replacing the website console settings to the Apache httpd.conf. I just commented // file_put_contents (__DIR__ . '\conf\httpd.conf', $serverconffile); and Apache httpd.conf will not be overwritten anymore. Nice.

See? The is one of the best parts of open-source. We can always Brute-Force it.

midnite
  • 5,157
  • 7
  • 38
  • 52
  • Yet I have to admit this is a Brute-Force solution. I am still waiting for your nicer solution. May be specifying the settings in another .conf file? – midnite May 14 '20 at 09:56
0

you have to comment line 66,67:

//$replacement = '${1}' . $server_port;
//$serverconffile = preg_replace('/^([\s|\t]*Listen.*\:[\s|\t]*)(.*)$/m', $replacement, $serverconffile);

the line update port number

fabien
  • 1