./configure --prefix=/usr/local/apache2 --enable-module=so --enable-rewrite=shared make make install
tar zxvf mysql-4.1.18.tar.gz cd mysql-4.1.18 ./configure --prefix=/usr/local/mysql --with-charset=gbk --localstatedir=/data/mysql make make install 添加mysql用户和组 groupadd mysql useradd -g mysql mysql /usr/local/mysql/bin/mysql_install_db chown -R mysql:mysql /data/mysql/var cp support-files/my-large.cnf /etc/my.cnf 根据自己需要,修改增加my.cnf的中相关选项 ----------------------------------启动MySQL服务---------------------------------- /usr/local/mysql/bin/mysqld_safe --user=mysql & ----------------------------------关闭MySQL服务---------------------------------- /usr/local/mysql/bin/mysqladmin -uroot -p shutdown
二进制版本的mysql,不需要配置,可以直接使用 : mysql-5.1.41-linux-i686-icc-glibc23.tar.gz
shell> groupadd mysql shell> useradd -g mysql -s /sbin/nologin -d /dev/null mysql shell> cd /usr/local/mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> bin/mysqld_safe --user=mysql &
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --enable-sockets --with-iconv --enable-mbstring --with-libxml-dir=/usr/local/libxml/ --with-ldap=/usr/local/openldap --enable-zip --with-zlib
然后检查 /usr/local/apache2/conf/httpd.conf 是否存在
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.html index.htm index.php
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
cd /usr/local/src/ wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.zip
unzip eaccelerator-0.9.5.3.zip ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config make make install
mkdir /tmp/eaccelerator && chmod 777 /tmp/eaccelerator && touch /var/log/eaccelerator_log
vi /usr/local/php/etc/php.ini 将 extension_dir = "./" 改为 extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" 然后在最后面加: [eaccelerator] extension=eaccelerator.so eaccelerator.shm_size="16" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.log_file = "/var/log/eaccelerator_log" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="0" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz cd ZendOptimizer-3.3.3-linux-glibc23-i386 ./install.sh 出现安装可视化界面,按提示一步一步进行即可 php.ini位置填写: /usr/local/php/etc/php.ini 是否使用apache web server选择是。
找到apache2的安装目录,然后编辑conf/httpd.conf 文件 在文件的最后加入下面的内容:
<IfModule mpm_prefork_module> ServerLimit 1024 StartServers 10 MinSpareServers 10 MaxSpareServers 20 MaxClients 1024 MaxRequestsPerChild 0 </IfModule>
注意:ServerLimit和MaxClients 要同时调整
方法一
安装cURL
# wget http://curl.haxx.se/download/curl-7.17.1.tar.gz # tar -zxf curl-7.17.1.tar.gz # ./configure --prefix=/usr/local/curl # make; make install
安装php
只要打开开关 --with-curl=/usr/local/curl
就可以了。
这个扩展库还是非常棒,是fsockopen等等相关的有效的替代品。
方法二 进入安装原php的源码目录,
cd ext cd curl phpize ./configure –with-curl=DIR make 就会在PHPDIR/ext/curl/moudles/下生成curl.so的文件。
复制curl.so文件到extensions的配置目录,修改php.ini就好了
# apachectl restart httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
解决:
# chcon -t texrel_shlib_t /usr/local/apache2/modules/libphp5.so
/php-5.2.5/sapi/cli/php: error while loading shared libraries: /usr/local/mysql/lib/libmysqlclient.so.15: cannot restore segment prot after reloc: Permission denied
解决办法如下:
禁用 SELinux # vi /etc/sysconfig/selinux SELINUX=disabled 使用 chcon # chcon -t texrel_shlib_t /usr/local/mysql/lib/libmysqlclient.so.15