非docker方式部署php后台
内网67宿主机(Ubuntu 18.04):
add-apt-repository -y ppa:ondrej/php
apt install php5.6
svn checkout http://192.168.31.20/svn/DTHero/mcGM --username hxh
apt install php5.6-bcmath php5.6-bz2 php5.6-curl php5.6-dba php5.6-dom php5.6-enchant php5.6-gd php5.6-gmp php5.6-imap php5.6-intl php5.6-ldap php5.6-mbstring php5.6-mcrypt php5.6-mongo php5.6-mysql php5.6-odbc php5.6-sqlite php5.6-pspell php5.6-simplexml php5.6-snmp php5.6-soap php5.6-tidy php5.6-xsl php5.6-zip
看情况执行:
apt-get install libapache2-mod-php5.6
ln -s /etc/apache2/mods-available/php5.6.load /etc/apache2/mods-enabled/php5.6.load
ln -s /etc/apache2/mods-available/php5.6.conf /etc/apache2/mods-enabled/php5.6.conf
/etc/init.d/apache2 restart
安装不上,但不影响:
apt-get install libapache2-mod-php5
必须执行的:
a2enmod rewrite
/etc/init.d/apache2 restart
验证:
http://192.168.31.67:8090/2.php?areanum=201&dbtype=1
http://192.168.31.67:8090/3.php?areanum=201&dbtype=1
http://192.168.31.69:8090/2.php?areanum=201&dbtype=1
http://192.168.31.69:8090/3.php?areanum=201&dbtype=1
<?php
if (isset($_GET['areanum']) && (isset($_GET['dbtype']))) {
$db = new mysqli('127.0.0.1', 'root', '123456', 'game_manager');
if ($db->connect_errno) {
echo "链接失败<br>";
} else {
echo "连接成功<br>";
$areanum = $_GET['areanum'];
$dbtype = $_GET['dbtype'];
$query = "SELECT id,dbip from server_mapping WHERE areanum=" . $areanum . " AND dbtype =" . $dbtype;
$result = $db->query($query);
if ($result) {
if ($result->num_rows) {
echo "成功<hr>";
} else {
echo "失败<hr>";
}
} else {
var_dump($db->error_list); // Returns a list of errors from the last command executed
}
$db->close();
}
}
<?php
if (isset($_GET['areanum']) && (isset($_GET['dbtype']))) {
$conn=mysql_connect("127.0.0.1","root","123456");
if(null == $conn) {
echo "链接失败<br>";
} else {
echo "连接成功<br>";
mysql_select_db("game_manager");
$areanum = $_GET['areanum'];
$dbtype = $_GET['dbtype'];
$query = "SELECT id,dbip from server_mapping WHERE areanum=" . $areanum . " AND dbtype =" . $dbtype;
$result=mysql_query($query);
echo "id dbip<br>";
while ($row=mysql_fetch_assoc($result))
{
$arr[]=$row;
echo $row[id]." ".$row[dbip]."<br>";
}
echo count($arr)."条记录<br>";
if ($result) {
$total = mysql_num_rows($result);
echo "成功返回".$total."条记录!<hr>";
} else {
echo "失败<hr>";
}
mysql_close();
}
}
?>
$_REQUEST[]具用$_POST[] $_GET[]的功能,但是$_REQUEST[]比较慢。通过POST和GET方法提交的所有数据都可以通过$_REQUEST数组获得
2010-2013年的一个php MVC框架,不是thinkphp,作者是FastAdmin框架的开发者Karson
https://www.awaimai.com/128.html
'5.6.40-12+ubuntu18.04.1+deb.sury.org+1' (length=38)
echo PHP_VERSION;
var_dump(PHP_VERSION);