一、更改yum源为网易的源加快速度
vi /etc/yum.repos.d/CentOS-Base.repo
更改内容如下

  1. # CentOS-Base.repo
  2. #
  3. # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
  4. # The mirror system uses the connecting IP address of the client and the
  5. # update status of each mirror to pick mirrors that are updated to and
  6. # geographically close to the client. You should use this for CentOS updates
  7. # unless you are manually picking other mirrors.
  8. #
  9. # If the mirrorlist= does not work for you, as a fall back you can try the
  10. # remarked out baseurl= line instead.
  11. #
  12. #
  13. [base]
  14. name=CentOS-$releasever - Base
  15. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  16. #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  17. baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
  18. gpgcheck=1
  19. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  20. #released updates
  21. [updates]
  22. name=CentOS-$releasever - Updates
  23. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  24. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  25. baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
  26. gpgcheck=1
  27. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  28. #packages used/produced in the build but not released
  29. [addons]
  30. name=CentOS-$releasever - Addons
  31. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
  32. #baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
  33. baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
  34. gpgcheck=1
  35. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  36. #additional packages that may be useful
  37. [extras]
  38. name=CentOS-$releasever - Extras
  39. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  40. #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
  41. baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
  42. gpgcheck=1
  43. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  44. #additional packages that extend functionality of existing packages
  45. [centosplus]
  46. name=CentOS-$releasever - Plus
  47. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  48. #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
  49. baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
  50. gpgcheck=1
  51. enabled=0
  52. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

二、update yum

  1. yum -y update

三、利用CentOS Linux系统自带的yum命令安装、升级所需的程序库

  1. LANG=C
  2. 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

Tags: , ,
by 大尾巴 | 来自 本站原创 | 不指定 2009/10/03 00:05 | 学习 | 评论(0) | 引用(0) | 阅读(375)

默认情况下,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

Tags: , ,
by 大尾巴 | 来自 本站原创 | 不指定 2009/10/02 23:28 | 学习 | 评论(0) | 引用(0) | 阅读(601)
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()
功能描述:将错误信
Tags:
by 大尾巴 | 来自 本站原创 | 不指定 2009/10/01 10:52 | 学习 | 评论(0) | 引用(0) | 阅读(225)
select * from table LIMIT 5,10; #返回第6-15行数据
select * from table LIMIT 5; #返回前5行
select * from table LIMIT 0,5; #返回前5行
by 大尾巴 | 来自 本站原创 | 不指定 2009/08/23 21:22 | 学习 | 评论(0) | 引用(0) | 阅读(201)
近日在看一个牛人的代码时,看到一个非常好用的函数: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 ]] )
本函数用来
by 大尾巴 | 来自 本站原创 | 不指定 2009/08/23 00:32 | 学习 | 评论(0) | 引用(0) | 阅读(165)
分页: 7/29 第一页 上页 2 3 4 5 6 7 8 9 10 11 下页 最后页 [ 显示模式: 摘要 | 列表 ]