@byxiaoxie5 年前
11/21
05:50
配置文件访问路径设置
原路径:root /www/wwwroot/xiaoxie;
修改后:root /www/wwwroot/xiaoxie/public;
伪静态设置
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
配置文件访问路径设置
原路径:root /www/wwwroot/xiaoxie;
修改后:root /www/wwwroot/xiaoxie/public;
伪静态设置
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
安装 OpenSSL:
yum install -y openssl
yum install -y openssl-devel
编译安装 libssh2:
cd /usr/local/src
wget https://www.libssh2.org/download/libssh2-1.8.0.tar.gz
tar -zxvf libssh2-1.8.0.tar.gz
cd libssh2-1.8.0
./configure --prefix=/usr/local/libssh2
make && make install
编译安装 ssh2:
cd /usr/local/src/
wget https://pecl.php.net/get/ssh2-1.1.2.tgz
tar -zxvf ssh2-1.1.2.tgz
cd ssh2-1.1.2
/www/server/php/54/bin/phpize (修改自己的对应PHP版本[我用的PHP54])
./configure --prefix=/usr/local/ssh2 --with-ssh2=/usr/local/libssh2 --with-php-config=/www/server/php/54/bin/php-config (修改自己的对应PHP版本[我用的PHP54])
make && make install
SSH2编译安装后有一个路径提示记录下来 如:/www/server/php/54/lib/php/extensions/no-debug-non-zts-20100525/
修改PHP配置文件添加扩展:
vim /www/server/php/54/etc/php.ini
把ssh2的路径添加到尾行
extension=/www/server/php/54/lib/php/extensions/no-debug-non-zts-20100525/ssh2.so
添加后重启php然后查看[phpinfo]看下是否扩展安装成功或在控制台输入[php -m | grep ssh2]成功后返回[ssh2]失败返回空白,如果报错查看路径是否正确
ssh2 编译安装报错:
更换ssh2版本:
wget http://pecl.php.net/get/ssh2-0.12.tgz
<!--
*****************
*By:TKS 17-7-13
******************
-->
<?php
if (isset($_POST['password']) && md5($_POST['password']) == md5('test'))
{
echo 'ByXiaoXie';
}
else
{
echo <<<'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ByXiaoXie</title>
</head>
<body>
<form action='' method='post'>
<input type='password' name="password" />
<input type='submit' value='LOGIN'>
</form>
</body>
</html>
EOF;
}
?>