目录

新增项目

安装php和系统运行环境

其他

× Linux性能vmstat vmstat

系统的一些推荐配置

php: memory_limit = 12M

linux常用命令

查看linux版本:cat /proc/version lsb_release -a

将一台机器的文件复制到另外一台机器:

scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root
yum install -y db4*
yum install -y ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel kernel

rpm -q db4 查看是否安装了db4

//配置文件
export 查看配置
declare -x LANG="zh_CN.GB18030:zh_CN.GB2312:zh_CN"  改语言
每次登录都有效,就写在
/etc/profile 
或者是 /home/usrname/.bash_profile里 /root/.bash_profile

程序后台运行
命令后加 &
nohup php once.php &

linux脚本

定时清除日志

DATE=`date -d -1days +%Y-%m-%d`
rm -rf /usr/local/apache2/logs/data.lenovo-access-$DATE*
rm -rf /usr/local/apache2/logs/data.lenovo.com-error-$DATE*

cd /usr/local/apache2/logs/
find  -name 'data.lenovo.com-error*_log' -type f -mtime +1 | xargs rm -f {} \;
find  -name 'data.lenovo.com-access*_log' -type f -mtime +1 | xargs rm -f {} \;

date

GD安装问题

php配置gd和freetype ,参考这篇文章

要注意的问题:

  • 先装jpeg-6b freetype libpng 等,最后安装 gd
  • 安装gd时使用参数: ./configure –with-jpeg=/usr/local –with-png=/usr/local –with-freetype=/usr/local
  • 重装编译php,必须加上参数: –with-gd=/usr/local –with-freetype-dir=/usr/local

gd一定要加上路径 /usr/local 其他可选: :–with-jpeg-dir=/usr/local –with-png-dir=/usr/local

–with-gd=/usr/local/ –with-jpeg –with-freetype-dir=/usr/local/lib

补充下: 下载 libxml2-2.6.26.tar.gz

zlib-1.2.3.tar.gz

freetype-2.3.5.tar.gz

libpng-1.2.23.tar.gz

jpegsrc.v6b.tar.gz

gd-2.0.35.tar.gz

前面4个包,安装的时候都是默认安装

./configure

make

make install

但是jpegsrc.v6b.tar.gz安装时候需要

./configure

make

make install-lib

make install 然后是编译GD ./configure –prefix=/usr/local –with-zlib=/usr/local –with-png=/usr/local –with-jpeg=/usr/local –with-freetype=/usr/local

make

make install

最后是编译php

./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql/ –with-config-file-path=/etc –with-iconv –enable-mbstring –with-libxml-dir=/usr/local/libxml/ –enable-zip –with-gd=/usr/local/ –with-jpeg-dir=/usr/local –with-png-dir=/usr/local –with-freetype-dir=/usr/local –with-zlib

make

make install

然后重启apache,这样就ok了

参考文章

linux/start.txt · 最后更改: 2013/11/19 20:30 由 kenvin
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0 红麦软件 红麦软件