是否可以同时运行多个服务器? [关闭]

I am creating a Wordpress site and I always use MAMP Pro. I just installed CodeKit 2 and it has its own server. I am now getting weird errors.

Is it possible to have two (or more ) servers running simultaneously? How can I tell which is running? How shut them down? Is it bad to run more than one? Will code (php) be executed on one or both of the servers?

That is correct. As @cs45977 said, you have to assign different port numbers to each server. The default port number for web servers is 80, but for development purposes people usually change it to 8080. The difference is that you have to tell your web browser what server to use by indicating a port number. The following URL uses the default 80 port:

http://www.myhost.com/

If you have a server listening on port 8080, you have to change it to:

http://www.myhost.com:8080/

So,

Is it possible to have two (or more ) servers running simultaneously?

Yes, you have to set a different port for each server.

How can I tell which is running?

You know it because of the port number you use in your URL (see my previous example)

How shut them down?

I don't have experience with MAMP, but my guess is that you have an icon on the icon tray where you can right click and select Shut Down. There should be one icon per running server.

Is it bad to run more than one?

It has a cost in resources (memory, processor). But if you're developing in your own computer (not a production server) it's not a big issue.

Will code (php) be executed on one or both of the servers?

It will run on the server you're connecting to.

As posted in the comments, Yes it it possible to have two servers but only one server per port.

You can use The MAMP Admin Tool (Control Panel) allows you to check the status, start, and stop the server. It as well as set the port apache runs on (via settings).