您的位置:首页 > 运维架构 > Linux

Linux平台php开发环境速建(Windows系统下)

2013-10-30 09:24 525 查看
转自:http://my.hupu.com/Anew_G/blog/6011243.html

1.使用Virtual box安装LAMP或LNMP集成包。

地址:http://www.wdlinux.cn/wdlinux_CentOS_5.5 (默认密码wdlinux.cn 其他请看说明或站内搜索)

安装完成后,继续安装中文输入法和图形界面

yum -y install scim*

yum -y install fonts-chinese

yum -y install fonts-ISO8859-2

cd /usr/share/fonts/

fc-cache -fv

reboot

重启后

yum groupinstall 'GNOME Desktop Environment' -y

如果用startx命令启动图形界面失败,则如下

yum install xorg-x11-server-Xorg

仍旧不行?用这个

yum reinstall xorg-x11-server-Xorg

2.安装虚拟机增强工具



点击完后

yum install kernel-devel  

yum install gcc 

ln -s /usr/src/kernels/2.6.18-......-i686 /usr/src/linux //省略号处用TAB键自动补全

进入到桌面上那个点击后挂载的光盘,获得所在路径并进入,然后
sh VBoxLinuxAdditions-x86.run

成功后屏幕可自适应调整与在win之间进行文字复制

3.升级php

cd /tmp

wget -c http://dl.wdlinux.cn:5180/soft/php-5.3.10.tar.gz tar zxvf php-5.3.10.tar.gz
cd php-5.3.10
./configure --prefix=/www/wdlinux/php-5.3.10 --with-config-file-path=/www/wdlinux/etc --with-mysql=/www/wdlinux/mysql --with-iconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr
--enable-xml --disable-rpath --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp --with-apxs2=/www/wdlinux/apache/bin/apxs
(上面这段直接复制到终端)
make
make install
rm -f /www/wdlinx/php
ln -s /www/wdlinux/php-5.3.10 /www/wdlinux/php
service httpd restart

4.配置phpmyadmin
到官网用wget下载后,解压到网站根目录(使用前mysql密码不能为空)
进入phpmyadmin文件夹
cp config.sample.inc.php config.inc.php
重启apache

5.配置vim
yum -y install vim-enhanced
cp /usr/share/vim/vim70/vimrc_example.vim ~/.vimrc
vim ~/.vimrc

随便找一行加入
set nocompatible

set fileencodings=ucs-bom,utf-8,gbk,default,latin1

set number 永久显示行数

set nobomb 无BOM格式

set t_Co=256

http://www.vim.org/scripts/script.php?script_id=2340 这个下个主题

主题放到:/usr/share/vim/vim70/colors

进入vimrc中,开一行加上 colorscheme ZZZ(ZZZ为主题名字,如molokai)

继续在vimrc中加入

filetype plugin on
autocmd FileType php set omnifunc=phpcomplete#CompletePHP

/* 打开了 phpcomplete ,Ctrl+X(插入模式下)打开函数列表,Ctrl+N(P)进行函数选择补全。ESC取消提示 */ http://www.vim.org/scripts/script.php?script_id=1355 下载 php-doc.vim

cp ./php-doc.vim /usr/share/vim/vim70/autoload/php-doc.vim

vimrc中加入:

source ~/.vim/php-doc.vim

inoremap :call PhpDocSingle()i

nnoremap :call PhpDocSingle()

vnoremap :call PhpDocRange()

/* 配置好了php documentor */ http://www.vim.org/scripts/script.php?script_id=1658
解压缩后把 plugin,doc,syntax,nerdtree_plugin 四个目录复制到/usr/share/vim/vim70/ 目录下

/*配置树形结构(在树形中o进入文件)Ctrl+W+h(l)在树形和文件中切换。*/ http://ctags.sourceforge.net/
解压后进入文件夹./configure && make && make install
http://vim.sourceforge.net/scripts/script.php?script_id=273
解压后

cp ./doc/taglist.txt /usr/share/vim/vim70/doc/

cp ./plugin/taglist.vim /usr/share/vim/vim70/plugin/

在vimrc文件中添加

set tags=tags;

set autochdir

/* 以后再需要的目录中ctags -R即可 */
http://www.vim.org/scripts/download_script.php?src_id=754
解压出来的东西cp到/usr/share/vim/vim70

vimrc中
let g:winManagerWindowLayout=’NERDTree,TagList|FileExplorer’

在vim中用:WMToggle调用

6.美化美化



这个依个人所好

7.配置Git
yum install curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel

wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz

进入目录

autoconf

./configure

make

make install

git --version

完成

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐