Home  >  Article  >  Backend Development  >  How to change port 80 in php5

How to change port 80 in php5

PHPz
PHPzOriginal
2023-03-21 16:32:171353browse

If you are a website administrator, you may encounter a situation where you need to change the PHP5 port from the default port 80. This process may be a little hurried, but as long as you follow the steps below, it will be easily completed.

First, you need to open the Apache2/conf/httpd.conf file, which can be achieved through an editor. Find the following two statements and remove the comment text mark (#).

LoadModule php5_module        modules/mod_php55.so
AddHandler php5-script php

After execution, you need to modify port 80. For better understanding, we change the port here to port 8080. Please refer to the following code for specific operations:

Listen 12.34.56.78:80
Listen 8080

Finally, you need to restart the Apache server for the new settings to take effect immediately. For specific instructions, please refer to the following:

$ sudo apache2ctl restart

At this point, you have completed the operation of changing the PHP5 port from the default port 80 to port 8080. Of course, if you want to change it back to the default port, we recommend that you simply undo the above changes.

Summary

If you are a website administrator, you may need to change the PHP5 port from the default port 80 for some reasons. However, this operation will become very easy to complete as long as you follow the above steps. If you encounter any problems, we strongly recommend that you seek immediate help from the relevant developer or technical support team.

The above is the detailed content of How to change port 80 in php5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn