How to deploy php game program
Here we use centos7 server to explain how to deploy php game program.
There is no difference between deploying game programs and ordinary programs. The steps are to build a PHP execution environment and upload the source code to the web environment.
1. Install httpd
yum install httpd -y
2. Start httpd
systemctl start httpd # service httpd start
3. Modify httpd Configuration, change the port to the port number required by the game
vim /etc/httpd/conf/httpd.conf
Find Listen 80 and change 80 to the port required by the game, such as: 8080
and then press esc - :wq Save and exit.
4. Restart the service
systemctl restart httpd # service httpd restart
5. Install php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Install php7
yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64
Install php-fpm
yum install php70w-fpm php70w-opcache
Start php-fpm
systemctl start php-fpm
Boot startup settings
systemctl enable php-fpm systemctl daemon-reload
6. Upload the game source code to the website root directory
7. If you are using a vps, you need to set up a security group with the service provider to open the ports used by the game.
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of How to deploy php game program. For more information, please follow other related articles on the PHP Chinese website!