Ubuntu下PHP开发配置(新增redis、sphinx、sqlserver相关配置)

由于本人比较懒,所以一般都是用xampp的直接拿来改的…………(当然xampp中一般php版本都是比较新的用的过程中请大家注意哈,可能会和老版本冲突)
此次除了使用xampp外,还扩展了sphinx,redis,sqlserver在linux中的配置等
 
#基础安装
apt-get install ssh
apt-get install vim
apt-get install subversion
apt-get install git-core
apt-get install curl
apt-get install redis-server:service redis-server status(注除了使用ubuntu自带的redis,还可以用下面redis的安装方法)
apt-get install mysql-client-core-5.5
apt-get install autoconf
 
#mysql(将xampp中的mysql命令标注为系统的mysql命令,可以将下面的这段加载到xampp启动的shell里面)
cd /var/run
mkdir mysqld
ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
 
#vim config (vim一些常用配置,省的每次打开都要set一下)
vim /etc/vim/vimrc
set tabstop=4
set encoding=utf-8
 
#redis config (除了ubuntu自带的redis外的安装方法)
cd /../phpredis
/opt/lampp/bin/phpize 
./configure --with-php-config=/opt/lampp/bin/php-config
make && make install
vim php.ini  (php新增redis配置)
extension="/.../redis.so"
session.save_handler = redis
session.save_path = "tcp://host1:6379?weight=1,tcp://host2:6379?weight=2&timeout=2.5,tcp://host3:6379?weight=2"
 
#unixODBC 下载unixODBC (linux下sqlserver的配置和安装)
cd unixODBC
./configure --prefix=/usr/local/unixODBC
vim /usr/local/unixODBC/etc/odbc.ini 
#配置内容
[ODBC Data Sources]
TEST1dsn = First Test DSN
[TEST1dsn]
Driver = /usr/local/freetds/lib/libtdsodbc.so
Description = First Test DSN
Trace = No
Servername = myserver
Database = xxx
UID = trace

[Default]
Driver          = /usr/local/freetds/lib/libtdsodbc.so

 
#freetds
 ./configure --prefix=/usr/local/freetds --with-unixodbc=/usr/local/unixODBC --with-tdsver=7.0
make && make install
[myserver] 
host= xxxx
port=1433
tds version=7.0

#下载个php 然后进入ext中查找pdo_odbc
./configure --with-php-config=/opt/lampp/bin/php-config --with-pdo-odbc=unixODBC,/usr/local/unixODBC
 
 
(sphinx扩展) 
未安装sphinx扩展:http://www.banping.com/2011/03/18/sphinx-php-extension/
./configure --with-php-config=/opt/lampp/bin/php-config
 
wget http://sphinx-for-chinese.googlecode.com/files/sphinx-for-chinese-2.1.0-dev-r3361.tar.bz2
上一篇:[Aaronyang] 写给自己的WPF4.5 笔记[2依赖属性]


下一篇:layer弹出层不居中解决方案,layer提示不屏幕居中解决方法,layer弹窗不居中解决方案