freetds
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib
make && make install
vi /usr/local/freetds/etc/freetds.conf
[global]
# TDS protocol version
tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512 client charset = GB2312 (解决返回值是乱码)
# A typical Sybase server
#[egServer50]
# host = symachine.domain.com
# port = 5000
# tds version = 5.0
# A typical Microsoft server
[mssql2k]
host = 192.168.0.49
port = 5628
tds version = 7.0
client charset = gb2312 mysql
yum -y install mysql mysql-server mysql-connector-odbc mysql-devel libdbi-dbd-mysql pdo-mysql
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list |grep mysql
service mysqld start
/usr/bin/mysql_secure_installation
httpd-2.2.15
参见: http://norman20000.blog.51cto.com/2707146/997799 php需要装以下包 tar -zxvf libiconv-1.13.tar.gz
cd libiconv-1.13
ls
ls
clear
./configure
make && make install
cd ..
ls tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
ls
./configure
make && make install
rpm -qa |grep mhash
ls
cd .. tar -zxvf mhash-0.9.9.9.tar.gz cd mhash-0.9.9.9
ls
./configure
make && make install
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
clear
rpm -qa |grep mcrypt
ls
cd .. tar -zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
ls
/sbin/ldconfig
ls
./configure
make && make install
GD支持 yum install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel tar -zxvf unixODBC-2.2.14-p2.tar.gz
cd unixODBC-2.2.14-p2
ls
./configure --enable-gui=no
make
make install php-5.2.13 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/etc/ --with-config-file-scan-dir=/etc/php.d --with-mysql --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-pdo-mysql --with-snmp --disable-ipv6 --with-mssql=/usr/local/freetds --with-unixODBC --enable-soap --with-sybase --enable-ftp --enable-dbase --enable-sockets --with-zlib --with-bz2 --enable-force-cgi-redirect --enable-gd-native-ttf --enable-exif --with-gdbm --disable-cgi --disable-cgi --with-pdo-odbc=unixODBC --enable-trans-sid
make ZEND_EXTRA_LIBS='-liconv'
make install
wget http://downloads.zend.com/optimizer/3.3.0a/ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz tar -zxvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.3.0a-linux-glibc21-i386
./install.sh
php.ini下optimizer
zend Optimizer
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.0a
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
// ================================
出现的问题:
vps上装了个ubuntu,配好apache、php、mysql,可怜的256就用去了211,在一次编译时出现virtual memory exhausted: Cannot allocate memory错误。
Google 了一下说是内存占用应该用ulimit -v 60000什么的限制在可用内存以下,但还是不行,要不就是出现不够用都错误,没办法,硬件条件太差,只好ps -aux看看哪些进程的内存占用比较厉害,先kill掉apache跟mysql,再make,终于,黑屏白字哗啦啦开始冒。
看来,很有必要对vps进行深度优化了。也有很多学习的机会。
另外,ubuntu折腾得乱七八糟,换个精简centos5继续从零开始。完美主义又开始作祟。
// ------------------------------
如果是编译php5.3大多都会报这么一个错
checking for QDBM support... no configure: error: DBA: Could not find necessary header file(s).
那么试试装下这两个包
For redhat users # yum install gdbm-devel
For ubuntu users # apt-get install libgdbm-dev
// ----------------------------
报 错configure: error: Cannot find ldap.h解决办法: yum install openldap yum install openldap-devel // --------------------------------------
[root@vps761 php-5.2.13]# make install
Installing PHP SAPI module: apache2handler
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' libphp5.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp libphp5.la /usr/local/apache/modules/
cp .libs/libphp5.so /usr/local/apache/modules/libphp5.so
cp .libs/libphp5.lai /usr/local/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /root/php-5.2.13/libs'
chmod 755 /usr/local/apache/modules/libphp5.so
[activating module `php5' in /usr/local/apache/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/php/bin/
Installing PHP CLI man page: /usr/local/php/man/man1/
Installing build environment: /usr/local/php/lib/php/build/
Installing header files: /usr/local/php/include/php/
Installing helper programs: /usr/local/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/php/lib/php/
[PEAR] Archive_Tar - installed: 1.3.3
[PEAR] Console_Getopt - installed: 1.2.3
[PEAR] Structures_Graph- installed: 1.0.2
[PEAR] XML_Util - installed: 1.2.1
[PEAR] PEAR - installed: 1.9.0
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
[root@vps761 php-5.2.13]# libtool --finish /root/php-5.2.13/libs
-bash: libtool: command not found
[root@vps761 php-5.2.13]# find . -name libtool
./libtool
[root@vps761 php-5.2.13]# ./libtool --finish /root/php-5.2.13/libs
PATH="$PATH:/sbin" ldconfig -n /root/php-5.2.13/libs
----------------------------------------------------------------------
Libraries have been installed in:
/root/php-5.2.13/libs
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
[root@localhost LAMP]#cp php.ini-development /usr/local/php/etc/php.ini 【cp php-x.x.x/php.ini-dist /opt/php/etc/php.ini 新版的 php.ini-development相当于旧版本的php.ini-dist】 解决了SESSION 不能跨页的问题