个人通过网络整合多人配置文章(跪拜大神)
安装163的 yum源:http://blog.csdn.net/fuwen1989/article/details/51078793
- nginx-1.5.2安装
1.环境准备
yum -y install gcc gcc-c++ autoconf automake make
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
2.安装nginx
wget http://nginx.org/download/nginx-1.5.2.tar.gz
tar xzvf nginx-1.5.2.tar.gz
cd nginx-1.5.2
./configure --prefix=/usr/local/nginx--with-http_stub_status_module--with-http_stub_status_module--with-http_realip_module --with-http_image_filter_module
make
makeinstall
打开
查看相关版本
3.检查nginx是否安装成功
cd /usr/local/nginx/sbin
./nginx -t
结果显示:
nginx: the configuration file/usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file/usr/local/nginx/conf/nginx.conf test is successful
如果这里报错的话 很有可能是你的那个pid的位置 ,你没有建立相关的文件夹
4. 添加nginx为系统服务
{
在/etc/init.d/目录下编写脚本,名为nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxyand IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
killall -9 nginx
}
restart() {
configtest || return $?
stop
sleep 1
start
}
reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0{start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac
[root@example ~]# cp nginx /etc/init.d/
[root@example ~]# chmod 755 /etc/init.d/nginx
[root@example ~]# chkconfig --add nginx
nginx启动、停止、无间断服务重启
[root@example ~]# service nginx start
[root@example ~]# service nginx stop
[root@example ~]# service nginx reload
完毕我想应该也可以按照此方法添加其他的服务
}
5. 检查nginx是否启动成功
浏览器中输入 http://你定义的IP:你定义的端口/
默认:127.0.0.1
如果看到这样一行大黑字Welcome to nginx!,就证明nginx已经工作了
6.配置nginx
vim/usr/local/nginx/conf/nginx.conf
server {
listen 80 default;
server_name localhost;
root /var/www/html/default;
#charsetkoi8-r;
#access_log logs/host.access.log main;
location / {
# root html;
index index.html index.htm;
}
....................
}
如上红色加粗显示部分,做三处修改:
listen 80后插入“空格default”
在里面加入一行 root/var/www/html/default;
注释掉root html;一行
上面的server{....}是定义的一台虚拟主机,我们刚加入的一行是定义这个虚假主机的web目录。listen行的default是表示这一个server{...}节点是默认的虚假主机(默认站点)
执行 nginx -t测试刚才的nginx配置文件是否有语法错误:
[root@fsvps nginx]# nginx -t
nginx: the configuration file/usr/local/conf/nginx/nginx.conf syntax is ok
nginx: configuration file/usr/local/conf/nginx/nginx.conf test is successful
显示没有错误,检测通过。如果不是这样,请返回仔细检查你的配置文件是否哪里写错了,注意行尾要有英文分号。
===============================================================================================
- 安装PHP5.5
1. 先卸载:
# yum remove php php-bcmath php-cli php-common php-develphp-fpm php-gd php-imap php-ldap php-mbstringphp-mcrypt php-mysql php-odbc php-pdo php-pear php-pecl-igbinary php-xml php-xmlrpc
2. 再安装 :
# yum install php55w php55w-bcmath php55w-cli php55w-common php55w-devel php55w-fpm php55w-gd php55w-imap php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql php55w-odbc php55w-pdo php55w-pear php55w-pecl-igbinary php55w-xml php55w-xmlrpc php55w-opcache php55w-intlphp55w-pecl-memcache
3. 安装swoole:
https://github.com/swoole/swoole-src/releases
# wgethttps://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz
tar zxvf swoole-1.7.6-stable.tar.gz
swoole-1.7.6-stable.tar.gz
phpize
./configure
make
make install
下面扩展加入到php.ini
extension=swoole.so
linuxphp.ini在哪
find /-name php.ini
php –m 查看已安装插件
4.配置nginx支持php
vim/usr/local/nginx/conf/nginx.conf
location / {
root /usr/local/nginx/html;
index index.html index.htm index.php;
}
server {
listen 80;
server_name localhost;
autoindex on;
#charsetkoi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /usr/local/nginx/html;
index index.html index.htm index.php;
}
location ~ \.php${
root /usr/local/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html $fastcgi_script_name;
include fastcgi_params;
}....
以下全是#号。
配置php-fpm
vim /etc/php-fpm.d/www.conf
将@php_fpm_user@改为当前系统的用户名,如下图,然后重新启动就ok了
5.启动服务并检测
chkconfig php-fpm on #设置php-fpm自启动
chkconfig mysqld on #设置mysqld自启动
service nginx restart #重新启动nginx
service php-fpm start #启动php-fpm
service mysqld start #启动mysqld
6.新建index.php
ROOT目录 /usr/local/nginx/html
Vim index.php
<?php
error_reporting(0); //抑制所有错误信息
@header("content-Type: text/html; charset=utf-8"); //语言强制
ob_start();
function valid_email($str)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
//检测PHP设置参数
function show($varName)
{
switch($result = get_cfg_var($varName))
{
case 0:
return '<font color="red">×</font>';
break;
case 1:
return '<font color="green">√</font>';
break;
default:
return $result;
break;
}
}
if ($_GET['act'] == "phpinfo")
{
phpinfo();
exit();
}
elseif($_GET['act'] == "Function")
{
$arr = get_defined_functions();
Function php()
{
}
echo "<pre>";
Echo "这里显示系统所支持的所有函数,和自定义函数\n";
print_r($arr);
echo "</pre>";
exit();
}elseif($_GET['act'] == "disable_functions")
{
$disFuns=get_cfg_var("disable_functions");
if(empty($disFuns))
{
$arr = '<font color=red>×</font>';
}
else
{
$arr = $disFuns;
}
Function php()
{
}
echo "<pre>";
Echo "这里显示系统被禁用的函数\n";
print_r($arr);
echo "</pre>";
exit();
}
//MySQL检测
if ($_POST['act'] == 'MySQL检测')
{
$host = isset($_POST['host']) ? trim($_POST['host']) : '';
$port = isset($_POST['port']) ? (int) $_POST['port'] : '';
$login = isset($_POST['login']) ? trim($_POST['login']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host;
$port = intval($port) ? intval($port) : '';
$login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login);
$password = is_string($password) ? htmlspecialchars($password) : '';
}
elseif ($_POST['act'] == '函数检测')
{
$funRe = "函数".$_POST['funName']."支持状况检测结果:".isfun1($_POST['funName']);
}
elseif ($_POST['act'] == '邮件检测')
{
$mailRe = "邮件发送检测结果:发送";
if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);}
else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);}
$mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!\n\nhttp://lnmp.org")) ? "完成":"失败";
}
// 检测函数支持
function isfun($funName = '')
{
if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误';
return (false !== function_exists($funName)) ? '<font color="green">√</font>' : '<font color="red">×</font>';
}
function isfun1($funName = '')
{
if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误';
return (false !== function_exists($funName)) ? '√' : '×';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>phpStudy 探针 2014 </title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
* {font-family: Tahoma, "Microsoft Yahei", Arial; }
body{text-align: center; margin: 0 auto; padding: 0; background-color:#FFFFFF;font-size:12px;font-family:Tahoma, Arial}
h1 {font-size: 26px; font-weight: normal; padding: 0; margin: 0; color: #444444;}
h1 small {font-size: 11px; font-family: Tahoma; font-weight: bold; }
a{color: #000000; text-decoration:none;}
a.black{color: #000000; text-decoration:none;}
b{color: #999999;}
table{clear:both;padding: 0; margin: 0 0 10px;border-collapse:collapse; border-spacing: 0;}
th{padding: 3px 6px; font-weight:bold;background:#3066a6;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
.th_1{padding: 3px 6px; font-weight:bold;background:#666699;color:#FFFFFF;border:1px solid #3066a6; text-align:left;}
tr{padding: 0; background:#F7F7F7;}
td{padding: 3px 6px; border:1px solid #CCCCCC;}
input{padding: 2px; background: #FFFFFF; border-top:1px solid #666666; border-left:1px solid #666666; border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; font-size:12px}
input.btn{font-weight: bold; height: 20px; line-height: 20px; padding: 0 6px; color:#666666; background: #f2f2f2; border:1px solid #999;font-size:12px}
.bar {border:1px solid #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
.bar_1 {border:1px dotted #999999; background:#FFFFFF; height:5px; font-size:2px; width:89%; margin:2px 0 5px 0;padding:1px;overflow: hidden;}
.barli_red{background:#ff6600; height:5px; margin:0px; padding:0;}
.barli_blue{background:#0099FF; height:5px; margin:0px; padding:0;}
.barli_green{background:#36b52a; height:5px; margin:0px; padding:0;}
.barli_1{background:#999999; height:5px; margin:0px; padding:0;}
.barli{background:#36b52a; height:5px; margin:0px; padding:0;}
#page {width: 920px; padding: 0 20px; margin: 0 auto; text-align: left;}
#header{position: relative; padding: 10px;}
#footer {padding: 15px 15px; text-align: left; font-size: 12px; font-family: Tahoma, Verdana;line-height:16px}
#lnmplink {position: absolute; top: 20px; left: 200px; text-align: right; font-weight: bold; color: #06C;}
#lnmplink a {color: #0000FF; text-decoration: underline;}
#lnmplink2 {position: absolute; top: 20px; right: 80px; text-align: right; font-weight: bold; color: #06C;}
#lnmplink2 a {color: #0000FF; text-decoration: underline;}
.w_small{font-family: Courier New;}
.w_number{color: #f800fe;}
.sudu {padding: 0; background:#5dafd1; }
.suduk { margin:0px; padding:0;}
.resNo{color: #FF0000;}
.word{word-break:break-all;}
-->
</style>
</head>
<body>
<div id="page">
<div id="header">
<h1>phpStudy 探针</h1>
<div id="lnmplink">for <a href="http://www.phpstudy.net/" target="_blank">phpStudy 2014</a></div>
<div id="lnmplink2">not <a href="http://www.phpstudy.net/a.php/192.html" target="_blank">不想显示 phpStudy 探针</a></div>
</div>
<!--服务器相关参数-->
<table width="100%" cellpadding="3" cellspacing="0">
<tr><th colspan="4">服务器参数</th></tr>
<tr>
<td>服务器域名/IP地址</td>
<td colspan="3"><?php echo $_SERVER['SERVER_NAME'];?>(<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>)</td>
</tr>
<tr>
<td>服务器标识</td>
<td colspan="3"><?php if($sysInfo['win_n'] != ''){echo $sysInfo['win_n'];}else{echo @php_uname();};?></td>
</tr>
<tr>
<td width="13%">服务器操作系统</td>
<td width="37%"><?php $os = explode(" ", php_uname()); echo $os[0];?> 内核版本:<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?></td>
<td width="13%">服务器解译引擎</td>
<td width="37%"><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
</tr>
<tr>
<td>服务器语言</td>
<td><?php echo getenv("HTTP_ACCEPT_LANGUAGE");?></td>
<td>服务器端口</td>
<td><?php echo $_SERVER['SERVER_PORT'];?></td>
</tr>
<tr>
<td>服务器主机名</td>
<td><?php if('/'==DIRECTORY_SEPARATOR ){echo $os[1];}else{echo $os[2];} ?></td>
<td>绝对路径</td>
<td><?php echo $_SERVER['DOCUMENT_ROOT']?str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']):str_replace('\\','/',dirname(__FILE__));?></td>
</tr>
<tr>
<td>管理员邮箱</td>
<td><?php echo $_SERVER['SERVER_ADMIN'];?></td>
<td>探针路径</td>
<td><?php echo str_replace('\\','/',__FILE__)?str_replace('\\','/',__FILE__):$_SERVER['SCRIPT_FILENAME'];?></td>
</tr>
</table>
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr>
<th colspan="4">PHP已编译模块检测</th>
</tr>
<tr>
<td colspan="4"><span class="w_small">
<?php
$able=get_loaded_extensions();
foreach ($able as $key=>$value) {
if ($key!=0 && $key%13==0) {
echo '<br />';
}
echo "$value ";
}
?></span>
</td>
</tr>
</table>
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="4">PHP相关参数</th></tr>
<tr>
<td width="32%">PHP信息(phpinfo):</td>
<td width="18%">
<?php
$phpSelf = $_SERVER[PHP_SELF] ? $_SERVER[PHP_SELF] : $_SERVER[SCRIPT_NAME];
$disFuns=get_cfg_var("disable_functions");
?>
<?php echo (false!==eregi("phpinfo",$disFuns))? '<font color="red">×</font>' :"<a href='$phpSelf?act=phpinfo' target='_blank'>PHPINFO</a>";?>
</td>
<td width="32%">PHP版本(php_version):</td>
<td width="18%"><?php echo PHP_VERSION;?></td>
</tr>
<tr>
<td>PHP运行方式:</td>
<td><?php echo strtoupper(php_sapi_name());?></td>
<td>脚本占用最大内存(memory_limit):</td>
<td><?php echo show("memory_limit");?></td>
</tr>
<tr>
<td>PHP安全模式(safe_mode):</td>
<td><?php echo show("safe_mode");?></td>
<td>POST方法提交最大限制(post_max_size):</td>
<td><?php echo show("post_max_size");?></td>
</tr>
<tr>
<td>上传文件最大限制(upload_max_filesize):</td>
<td><?php echo show("upload_max_filesize");?></td>
<td>浮点型数据显示的有效位数(precision):</td>
<td><?php echo show("precision");?></td>
</tr>
<tr>
<td>脚本超时时间(max_execution_time):</td>
<td><?php echo show("max_execution_time");?>秒</td>
<td>socket超时时间(default_socket_timeout):</td>
<td><?php echo show("default_socket_timeout");?>秒</td>
</tr>
<tr>
<td>PHP页面根目录(doc_root):</td>
<td><?php echo show("doc_root");?></td>
<td>用户根目录(user_dir):</td>
<td><?php echo show("user_dir");?></td>
</tr>
<tr>
<td>dl()函数(enable_dl):</td>
<td><?php echo show("enable_dl");?></td>
<td>指定包含文件目录(include_path):</td>
<td><?php echo show("include_path");?></td>
</tr>
<tr>
<td>显示错误信息(display_errors):</td>
<td><?php echo show("display_errors");?></td>
<td>自定义全局变量(register_globals):</td>
<td><?php echo show("register_globals");?></td>
</tr>
<tr>
<td>数据反斜杠转义(magic_quotes_gpc):</td>
<td><?php echo show("magic_quotes_gpc");?></td>
<td>"<?...?>"短标签(short_open_tag):</td>
<td><?php echo show("short_open_tag");?></td>
</tr>
<tr>
<td>"<% %>"ASP风格标记(asp_tags):</td>
<td><?php echo show("asp_tags");?></td>
<td>忽略重复错误信息(ignore_repeated_errors):</td>
<td><?php echo show("ignore_repeated_errors");?></td>
</tr>
<tr>
<td>忽略重复的错误源(ignore_repeated_source):</td>
<td><?php echo show("ignore_repeated_source");?></td>
<td>报告内存泄漏(report_memleaks):</td>
<td><?php echo show("report_memleaks");?></td>
</tr>
<tr>
<td>自动字符串转义(magic_quotes_gpc):</td>
<td><?php echo show("magic_quotes_gpc");?></td>
<td>外部字符串自动转义(magic_quotes_runtime):</td>
<td><?php echo show("magic_quotes_runtime");?></td>
</tr>
<tr>
<td>打开远程文件(allow_url_fopen):</td>
<td><?php echo show("allow_url_fopen");?></td>
<td>声明argv和argc变量(register_argc_argv):</td>
<td><?php echo show("register_argc_argv");?></td>
</tr>
<tr>
<td>Cookie 支持:</td>
<td><?php echo isset($_COOKIE)?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
<td>拼写检查(ASpell Library):</td>
<td><?php echo isfun("aspell_check_raw");?></td>
</tr>
<tr>
<td>高精度数学运算(BCMath):</td>
<td><?php echo isfun("bcadd");?></td>
<td>PREL相容语法(PCRE):</td>
<td><?php echo isfun("preg_match");?></td>
<tr>
<td>PDF文档支持:</td>
<td><?php echo isfun("pdf_close");?></td>
<td>SNMP网络管理协议:</td>
<td><?php echo isfun("snmpget");?></td>
</tr>
<tr>
<td>VMailMgr邮件处理:</td>
<td><?php echo isfun("vm_adduser");?></td>
<td>Curl支持:</td>
<td><?php echo isfun("curl_init");?></td>
</tr>
<tr>
<td>SMTP支持:</td>
<td><?php echo get_cfg_var("SMTP")?'<font color="green">√</font>' : '<font color="red">×</font>';?></td>
<td>SMTP地址:</td>
<td><?php echo get_cfg_var("SMTP")?get_cfg_var("SMTP"):'<font color="red">×</font>';?></td>
</tr>
<tr>
<td>默认支持函数(enable_functions):</td>
<td colspan="3"><a href='<?php echo $phpSelf;?>?act=Function' target='_blank' class='static'>请点这里查看详细!</a></td>
</tr>
<tr>
<td>被禁用的函数(disable_functions):</td>
<td colspan="3" class="word">
<?php
$disFuns=get_cfg_var("disable_functions");
if(empty($disFuns))
{
echo '<font color=red>×</font>';
}
else
{
//echo $disFuns;
$disFuns_array = explode(',',$disFuns);
foreach ($disFuns_array as $key=>$value)
{
if ($key!=0 && $key%5==0) {
echo '<br />';
}
echo "$value ";
}
}
?>
</td>
</tr>
</table>
<!--组件信息-->
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="4" >组件支持</th></tr>
<tr>
<td width="32%">FTP支持:</td>
<td width="18%"><?php echo isfun("ftp_login");?></td>
<td width="32%">XML解析支持:</td>
<td width="18%"><?php echo isfun("xml_set_object");?></td>
</tr>
<tr>
<td>Session支持:</td>
<td><?php echo isfun("session_start");?></td>
<td>Socket支持:</td>
<td><?php echo isfun("socket_accept");?></td>
</tr>
<tr>
<td>Calendar支持</td>
<td><?php echo isfun('cal_days_in_month');?>
</td>
<td>允许URL打开文件:</td>
<td><?php echo show("allow_url_fopen");?></td>
</tr>
<tr>
<td>GD库支持:</td>
<td>
<?php
if(function_exists(gd_info)) {
$gd_info = @gd_info();
echo $gd_info["GD Version"];
}else{echo '<font color="red">×</font>';}
?></td>
<td>压缩文件支持(Zlib):</td>
<td><?php echo isfun("gzclose");?></td>
</tr>
<tr>
<td>IMAP电子邮件系统函数库:</td>
<td><?php echo isfun("imap_close");?></td>
<td>历法运算函数库:</td>
<td><?php echo isfun("JDToGregorian");?></td>
</tr>
<tr>
<td>正则表达式函数库:</td>
<td><?php echo isfun("preg_match");?></td>
<td>WDDX支持:</td>
<td><?php echo isfun("wddx_add_vars");?></td>
</tr>
<tr>
<td>Iconv编码转换:</td>
<td><?php echo isfun("iconv");?></td>
<td>mbstring:</td>
<td><?php echo isfun("mb_eregi");?></td>
</tr>
<tr>
<td>高精度数学运算:</td>
<td><?php echo isfun("bcadd");?></td>
<td>LDAP目录协议:</td>
<td><?php echo isfun("ldap_close");?></td>
</tr>
<tr>
<td>MCrypt加密处理:</td>
<td><?php echo isfun("mcrypt_cbc");?></td>
<td>哈稀计算:</td>
<td><?php echo isfun("mhash_count");?></td>
</tr>
</table>
<!--第三方组件信息-->
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="4" >第三方组件</th></tr>
<tr>
<td width="32%">Zend版本</td>
<td width="18%"><?php $zend_version = zend_version();if(empty($zend_version)){echo '<font color=red>×</font>';}else{echo $zend_version;}?></td>
<td width="32%">
<?php
$PHP_VERSION = PHP_VERSION;
$PHP_VERSION = substr($PHP_VERSION,2,1);
if($PHP_VERSION > 2)
{
echo "ZendGuardLoader[启用]";
}
else
{
echo "Zend Optimizer";
}
?>
</td>
<td width="18%"><?php if($PHP_VERSION > 2){echo (get_cfg_var("zend_loader.enable"))?'<font color=green>√</font>':'<font color=red>×</font>';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'<font color=green>√</font>':'<font color=red>×</font>';}}?></td>
</tr>
<tr>
<td>eAccelerator</td>
<td><?php if((phpversion('eAccelerator'))!=''){echo phpversion('eAccelerator');}else{ echo "<font color=red>×</font>";} ?></td>
<td>ioncube</td>
<td><?php if(extension_loaded('ionCube Loader')){ $ys = ioncube_loader_iversion(); $gm = ".".(int)substr($ys,3,2); echo ionCube_Loader_version().$gm;}else{echo "<font color=red>×</font>";}?></td>
</tr>
<tr>
<td>XCache</td>
<td><?php if((phpversion('XCache'))!=''){echo phpversion('XCache');}else{ echo "<font color=red>×</font>";} ?></td>
<td>APC</td>
<td><?php if((phpversion('APC'))!=''){echo phpversion('APC');}else{ echo "<font color=red>×</font>";} ?></td>
</tr>
</table>
<!--数据库支持-->
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="4">数据库支持</th></tr>
<tr>
<td width="32%">MySQL 数据库:</td>
<td width="18%"><?php echo isfun("mysql_close");?>
<?php
if(function_exists("mysql_get_server_info")) {
$s = @mysql_get_server_info();
$s = $s ? ' mysql_server 版本:'.$s : '';
$c = ' mysql_client 版本:'.@mysql_get_client_info();
echo $s;
}
?>
</td>
<td width="32%">ODBC 数据库:</td>
<td width="18%"><?php echo isfun("odbc_close");?></td>
</tr>
<tr>
<td>Oracle 数据库:</td>
<td><?php echo isfun("ora_close");?></td>
<td>SQL Server 数据库:</td>
<td><?php echo isfun("mssql_close");?></td>
</tr>
<tr>
<td>dBASE 数据库:</td>
<td><?php echo isfun("dbase_close");?></td>
<td>mSQL 数据库:</td>
<td><?php echo isfun("msql_close");?></td>
</tr>
<tr>
<td>SQLite 数据库:</td>
<td><?php if(extension_loaded('sqlite3')) {$sqliteVer = SQLite3::version();echo '<font color=green>√</font> ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '<font color="green">√</font>') {echo " 版本: ".@sqlite_libversion();}}?></td>
<td>Hyperwave 数据库:</td>
<td><?php echo isfun("hw_close");?></td>
</tr>
<tr>
<td>Postgre SQL 数据库:</td>
<td><?php echo isfun("pg_close"); ?></td>
<td>Informix 数据库:</td>
<td><?php echo isfun("ifx_close");?></td>
</tr>
<tr>
<td>DBA 数据库:</td>
<td><?php echo isfun("dba_close");?></td>
<td>DBM 数据库:</td>
<td><?php echo isfun("dbmclose");?></td>
</tr>
<tr>
<td>FilePro 数据库:</td>
<td><?php echo isfun("filepro_fieldcount");?></td>
<td>SyBase 数据库:</td>
<td><?php echo isfun("sybase_close");?></td>
</tr>
</table>
<form action="<?php echo $_SERVER[PHP_SELF]."#bottom";?>" method="post">
<!--MySQL数据库连接检测-->
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="3">MySQL数据库连接检测</th></tr>
<tr>
<td width="15%"></td>
<td width="60%">
地址:<input type="text" name="host" value="localhost" size="10" />
端口:<input type="text" name="port" value="3306" size="10" />
用户名:<input type="text" name="login" size="10" />
密码:<input type="password" name="password" size="10" />
</td>
<td width="25%">
<input class="btn" type="submit" name="act" value="MySQL检测" />
</td>
</tr>
</table>
<?php
if ($_POST['act'] == 'MySQL检测') {
if(function_exists("mysql_close")==1) {
$link = @mysql_connect($host.":".$port,$login,$password);
if ($link){
echo "<script>alert('连接到MySql数据库正常')</script>";
} else {
echo "<script>alert('无法连接到MySql数据库!')</script>";
}
} else {
echo "<script>alert('服务器不支持MySQL数据库!')</script>";
}
}
?>
<!--函数检测-->
<table width="100%" cellpadding="3" cellspacing="0" align="center">
<tr><th colspan="3">函数检测</th></tr>
<tr>
<td width="15%"></td>
<td width="60%">
请输入您要检测的函数:
<input type="text" name="funName" size="50" />
</td>
<td width="25%">
<input class="btn" type="submit" name="act" align="right" value="函数检测" />
</td>
</tr>
<?php
if ($_POST['act'] == '函数检测') {
echo "<script>alert('$funRe')</script>";
}
?>
</table>
</form>
</div>
</body>
</html>
- 安装Mysql5.1
输入:yum list installed | grep mysql
2.若有自带安装的mysql,
输入:yum -y remove mysql-libs.x86_64,若有多个依赖文件则依次卸载。
3.查看yum库上的mysql版本信息(CentOS系统需要正常连接网络)。
输入:yum list | grep mysql 或 yum -y list mysql*
4.使用yum安装mysql数据库。
输入:yum -y install mysql-server mysql mysql-devel ,命令将:mysql-server、mysql、mysql-devel都安装好,
当结果显示为“Complete!”即安装完毕。
5.查看刚安装mysql数据库版本信息。
输入:rpm -qi mysql-server