The PHPEMS online simulation test system for project deployment (valid for pro-test, including PHP source code) is deployed on Alibaba Cloud server

PHPEMS online mock examination system Alibaba Cloud server deployment

I believe that many people are looking for this source code. The editor is the same. I also have a big dream, which is to bring us heroes together. For example, this online examination system can be realized, and all the operations can be performed on it. All the interview questions are deployed for everyone to practice. The editor also has an idea to explain every interview question in the form of recording and broadcasting . So the editor has a cloud server to build and deploy one, and the editor also I will let this platform run for a period of time. I hope everyone can come to the platform to do some questions. I will leave a comment. Thank you.

Due to tariff issues, the platform is currently closed. You can deploy one by yourself according to the following steps to play

At present, the editor has not arranged the question bank on it. You can register for an account to play. When the editor has a good question bank, you can migrate the platform to a safer environment, so that everyone can play with confidence. The key is The editor is also very tired this week and I want to take a break. If you have a good question bank, you can send a private message to the editor. The editor will save some effort.

The purchase of Alibaba Cloud servers this time is just a random collocation of personal websites, not suitable for precise configuration of large enterprises

  • Platform function
  • Online exam
  • Course Sharing
  • Press Releases
  • Certificate acquisition and more

Don't talk nonsense, look at the renderings first

Insert picture description here

Roll up your sleeves and do it, shake it up

Deploy on the cloud server, you can decide to have a cloud server first, buy a cloud server first

System environment

system system version RAM
Linux centos7.5 >2G

Purchase Alibaba Cloud server ecs

Log in to Alibaba Cloud and enter the console

Aliyun website : https://www.aliyun.com/ If you
don’t have an account, you can register one yourself. The registration steps are relatively simple. Just follow the prompts and go down step by step.
Insert picture description here

Buy ecs server

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here
The instance startup time is a bit longer, just wait a few tens of seconds
Insert picture description here

Connect to the cloud server

There are many ways to connect to cloud services, we still use our oldest method to connect with xshell

The public network ip of the replication server

Insert picture description here
Insert picture description here

Deploy the lnmp environment

Deploy the pdo_mysql extension

##首先确保nginx,php,mysql服务全部开启
[root@phpems ~]# ss -antup | grep 80
tcp    LISTEN     0      80        *:3306                  *:*                   users:(("mysqld",pid=1801,fd=10))
tcp    LISTEN     0      128       *:80                    *:*                   users:(("nginx",pid=1489,fd=6),("nginx",pid=1488,fd=6))
[root@phpems ~]# ss -antup | grep 9000
tcp    LISTEN     0      128    127.0.0.1:9000                  *:*                   users:(("php-fpm",pid=1493,fd=0),("php-fpm",pid=1492,fd=0),("php-fpm",pid=1491,fd=7))
[root@phpems ~]# ss -antup | grep 3306
tcp    LISTEN     0      80        *:3306                  *:*                   users:(("mysqld",pid=1801,fd=10))

[root@phpems ~]# php -m   #检查php编译部署时安装的扩展,发现没有pdo_mysql
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
ereg
fileinfo
filter
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

###开始部署一下pdo_mysql扩展


[root@phpems ~]# cd /usr/src/php-5.6.40/   #到之前解压php压缩包的目录下面
[root@phpems php-5.6.40]# cd ext/   #到扩展目录里面
[root@phpems ext]# cd pdo_mysql/  #到pdo_mysql扩展目录里面,准备进行编译

[root@phpems pdo_mysql]# find / -type f -name "*phpize*"   #查找phpize命令所在位置
/usr/local/php/lib/php/build/phpize.m4
/usr/local/php/bin/phpize   #这个就是我们要找的phpize命令
/usr/local/php/php/man/man1/phpize.1
/usr/src/php-5.6.40/scripts/man1/phpize.1.in
/usr/src/php-5.6.40/scripts/man1/phpize.1
/usr/src/php-5.6.40/scripts/phpize.m4
/usr/src/php-5.6.40/scripts/phpize.in
/usr/src/php-5.6.40/scripts/phpize
/usr/src/php-5.6.40/win32/build/phpize.js.in
/usr/src/php-5.6.40/win32/build/Makefile.phpize
/usr/src/php-5.6.40/win32/build/config.w32.phpize.in
/usr/src/php-5.6.40/win32/build/phpize.bat

[root@phpems pdo_mysql]# /usr/local/php/bin/phpize   #利用绝对路径执行命令
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
Cannot find autoconf. Please check your autoconf installation and the   ####发现报错,提示没有autoconf服务
$PHP_AUTOCONF environment variable. Then, rerun this script.

[root@phpems pdo_mysql]# yum -y install autoconf   #安装autoconf服务
已加载插件:fastestmirror
Determining fastest mirrors
epel/x86_64/metalink                                                                                                      | 5.4 kB  00:00:00     
 * base: mirrors.bfsu.edu.cn
 * epel: mirrors.bfsu.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
******************************
省略
****************************
Running transaction
  正在安装    : m4-1.4.16-10.el7.x86_64                                                                                                      1/2 
  正在安装    : autoconf-2.69-11.el7.noarch                                                                                                  2/2 
  验证中      : m4-1.4.16-10.el7.x86_64                                                                                                      1/2 
  验证中      : autoconf-2.69-11.el7.noarch                                                                                                  2/2 

已安装:
  autoconf.noarch 0:2.69-11.el7                                                                                                                  

作为依赖被安装:
  m4.x86_64 0:1.4.16-10.el7                                                                                                                      

完毕!

[root@phpems pdo_mysql]# /usr/local/php/bin/phpize   #再次执行命令
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226

[root@phpems pdo_mysql]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql/  #第一个路径是编译安装php的路径,第二个路径是编译安装的路径
*************8省略
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h



[root@lnmp pdo_mysql]# make   #make 一下
***********
省略
********
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.


[root@phpems pdo_mysql]# make install   #make install 一下
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/  #这个路径要记录下来


[root@phpems pdo_mysql]# php --ini   #查找php的配置文件位置
Configuration File (php.ini) Path: /usr/local/php/etc
Loaded Configuration File:         /usr/local/php/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)
[root@phpems pdo_mysql]# echo "extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so" >> /usr/local/php/etc/php.ini   #修改php的配置文件,里面的路径就是上面要记得路径后面加上pdo_mysql.so文件

[root@phpems pdo_mysql]# php -m | grep pdo 
pdo_mysql   #发现已经有了pdo_mysql扩展了,再这里先不忙着重启php,到最后统一重启
pdo_sqlite

Unzip the source code to the website directory

If you follow Xiaobian's deployment, your website directory is under /usr/local/nginx/html. The unzip tool can be installed through the yum -y install unzip command to install the unzip unzip tool, the command unzip + package name.zip, you can unzip to the current directory

[root@phpems ~]# ls /usr/local/nginx/html/
api  app  data  files  index.php  lib  pe6.sql  phpems.zip  tasks
源码获取地址
链接:https://pan.baidu.com/s/1FWo2T30YA4uS_xMSuTHB7A 
提取码:vj0z 
复制这段内容后打开百度网盘手机App,操作更方便哦

Create a database connection account and import the tables required by the platform

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> create database kaoshi;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| kaoshi             |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)


mysql>GRANT ALL PRIVILEGES ON kaoshi.* TO 'phpems'@'127.0.0.1' IDENTIFIED BY '这里用自己的密码';
Query OK, 0 rows affected (0.00 sec)

mysql> use kaoshi;
Database changed
mysql> source /usr/local/nginx/html/pe6.sql;
************
省略
*********
Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

###测试下新创建的用户是否可以连接

[root@phpems ~]# mysql -uphpems -p密码 -h127.0.0.1
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.39 Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| kaoshi             |
| test               |
+--------------------+
3 rows in set (0.00 sec)


Modify the database connection configuration file

[root@phpems ~]# vim /usr/local/nginx/html/lib/config.inc.php 

******省略
/** 数据库设置 */
define('SQLDEBUG',1);
define('DB','kaoshi');//MYSQL数据库名
define('DH','127.0.0.1');//MYSQL主机名,不用改
define('DU','root');//MYSQL数据库用户名
define('DP','密码');//MYSQL数据库用户密码
define('DTH','x2_');//系统表前缀,不用改
*********省略

Add permissions to the corresponding directory

[root@phpems ~]# chmod 777 /usr/local/nginx/html/data/ /usr/local/nginx/html/files/attach/

Change the security group of the cloud server and release the platform port

[root@phpems ~]# ss -antup | grep nginx   #可以看到我用的是80端口
tcp    LISTEN     0      128       *:80                    *:*                   users:(("nginx",pid=28709,fd=6),("nginx",pid=28708,fd=6))

It should be noted here that port 80 is enabled by default, because we did not change the security group when we created ecs earlier. You can check it in the security group. If it is not enabled, please enable it.
Insert picture description here
Insert picture description here

Visit the platform built by the test

默认管理员:
用户名:peadmin
密码:peadmin

Insert picture description here

Concluding remarks

The editor will still change the super administrator. Don’t use the administrator to log in on the platform of the editor. Because the time is too late, and the editor is very tired this week, I want to take a good rest. , Now the cloud server, the editor is open for everyone, you can go to it to register for an account to play, but there is no update of the question bank in it, I hope you can support the work of the editor, you can privately send the editor to the editor about the question bank, Let the editor add it, so that it is convenient for you and me, and it is more convenient for everyone

Guess you like

Origin blog.csdn.net/guijianchouxyz/article/details/115016208