一、更改yum源为网易的源加快速度
vi /etc/yum.repos.d/CentOS-Base.repo
更改内容如下
- # CentOS-Base.repo
- #
- # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
- # The mirror system uses the connecting IP address of the client and the
- # update status of each mirror to pick mirrors that are updated to and
- # geographically close to the client. You should use this for CentOS updates
- # unless you are manually picking other mirrors.
- #
- # If the mirrorlist= does not work for you, as a fall back you can try the
- # remarked out baseurl= line instead.
- #
- #
- [base]
- name=CentOS-$releasever - Base
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
- #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
- baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #released updates
- [updates]
- name=CentOS-$releasever - Updates
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
- #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
- baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #packages used/produced in the build but not released
- [addons]
- name=CentOS-$releasever - Addons
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
- #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
- baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
- #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
- baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever - Plus
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
- #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
- baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
二、update yum
- yum -y update
三、利用CentOS Linux系统自带的yum命令安装、升级所需的程序库
- LANG=C
- yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
四、安装php和mysql
默认情况下,yum不能安装nginx,但是,借助一个插件,可以安装。
步骤也非常的简单。如下:
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm
# yum install nginx
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
Importing GPG key 0×217521F6 “Fedora EPEL <epel@fedoraproject.org>” from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
然后就可以启动nginx了
/etc/init.d/nginx start
OK
PHP 危险函数解释
*** 在编译 PHP 时,如无特殊需要,一定禁止编译生成 CLI 命令行模式的 PHP 解析支持。
可在编译时使用 –disable-cli。一旦编译生成 CLI 模式的 PHP,则可能会被入侵者
利用该程序建立一个 WEB Shell 后门进程或通过 PHP 执行任意代码!
phpinfo()
功能描述:输出 PHP 环境信息以及相关的模块、WEB 环境等信息。
危险等级:中
passthru()
功能描述:允许执行一个外部程序并回显输出,类似于 exec()。
危险等级:高
exec()
功能描述:允许执行一个外部程序(如 UNIX Shell 或 CMD 命令等)。
危险等级:高
system()
功能描述:允许执行一个外部程序并回显输出,类似于 passthru()。
危险等级:高
chroot()
功能描述:可改变当前 PHP 进程的工作根目录,仅当系统支持 CLI 模式
PHP 时才能工作,且该函数不适用于 Windows 系统。
危险等级:高
scandir()
功能描述:列出指定路径中的文件和目录。
危险等级:中
chgrp()
功能描述:改变文件或目录所属的用户组。
危险等级:高
chown()
功能描述:改变文件或目录的所有者。
危险等级:高
shell_exec()
功能描述:通过 Shell 执行命令,并将执行结果作为字符串返回。
危险等级:高
proc_open()
功能描述:执行一个命令并打开文件指针用于读取以及写入。
危险等级:高
proc_get_status()
功能描述:获取使用 proc_open() 所打开进程的信息。
危险等级:高
error_log()
功能描述:将错误信
*** 在编译 PHP 时,如无特殊需要,一定禁止编译生成 CLI 命令行模式的 PHP 解析支持。
可在编译时使用 –disable-cli。一旦编译生成 CLI 模式的 PHP,则可能会被入侵者
利用该程序建立一个 WEB Shell 后门进程或通过 PHP 执行任意代码!
phpinfo()
功能描述:输出 PHP 环境信息以及相关的模块、WEB 环境等信息。
危险等级:中
passthru()
功能描述:允许执行一个外部程序并回显输出,类似于 exec()。
危险等级:高
exec()
功能描述:允许执行一个外部程序(如 UNIX Shell 或 CMD 命令等)。
危险等级:高
system()
功能描述:允许执行一个外部程序并回显输出,类似于 passthru()。
危险等级:高
chroot()
功能描述:可改变当前 PHP 进程的工作根目录,仅当系统支持 CLI 模式
PHP 时才能工作,且该函数不适用于 Windows 系统。
危险等级:高
scandir()
功能描述:列出指定路径中的文件和目录。
危险等级:中
chgrp()
功能描述:改变文件或目录所属的用户组。
危险等级:高
chown()
功能描述:改变文件或目录的所有者。
危险等级:高
shell_exec()
功能描述:通过 Shell 执行命令,并将执行结果作为字符串返回。
危险等级:高
proc_open()
功能描述:执行一个命令并打开文件指针用于读取以及写入。
危险等级:高
proc_get_status()
功能描述:获取使用 proc_open() 所打开进程的信息。
危险等级:高
error_log()
功能描述:将错误信
select * from table LIMIT 5,10; #返回第6-15行数据
select * from table LIMIT 5; #返回前5行
select * from table LIMIT 0,5; #返回前5行
select * from table LIMIT 5; #返回前5行
select * from table LIMIT 0,5; #返回前5行
近日在看一个牛人的代码时,看到一个非常好用的函数:extract(),它的主要作用是将数组展开,键名作为变量名,元素值为变量值,可以说为数组的操作提供了另外一个方便的工具,比方说,可以很方便的提取$_POST或者$_GET的元素,对表单提交上来的内容不能不用一一赋值,直接使用下面代码:
form.html
<form action="action.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit">
在action.php中只要使用extract()函数将$_POST全局数据解开:
action.php
<?php
extract($_POST);
//相当于$username = $_POST['username'];
//$password = $_POST['password'];
?>
是不是很方便呢?呵呵,下面是PHP手册里的详细解释:
extract
(PHP 4, PHP 5)
extract — 从数组中将变量导入到当前的符号表
说明
int extract ( array $var_array [, int $extract_type [, string $prefix ]] )
本函数用来
form.html
<form action="action.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit">
在action.php中只要使用extract()函数将$_POST全局数据解开:
action.php
<?php
extract($_POST);
//相当于$username = $_POST['username'];
//$password = $_POST['password'];
?>
是不是很方便呢?呵呵,下面是PHP手册里的详细解释:
extract
(PHP 4, PHP 5)
extract — 从数组中将变量导入到当前的符号表
说明
int extract ( array $var_array [, int $extract_type [, string $prefix ]] )
本函数用来






2009/10/03 00:05 | 
