更新yum源
wget http://sudone.com/download/CentOS-Base.repo -O /etc/yum.repos.d/CentOS-Base.repo
说明:
不要直接复制 有些执行不了 符号有问题 我没修改
suhosin-patch
下载地址:http://www.hardened-php.net/suhosin/
php-5.2.14-fpm-0.9.7.diff.gz
下载地址:http://php-fpm.org/downloads/
其他的网上搜
首先安装相关依赖包:
sudo -s
LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
安装MySQL:
[root@Linux~]#tar zxvf mysql-5.1.51.tar.gz
[root@Linux~]#cd mysql-5.1.51/
[root@Linux mysql-5.1.51]#./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
[root@Linux mysql-5.1.51]#make && make install
[root@Linux mysql-5.1.51]#groupadd mysql
[root@Linux mysql-5.1.51]#useradd –g mysql mysql
[root@Linux mysql-5.1.51]#/usr/local/mysql/bin/mysql_install_db –user=mysql
[root@Linux mysql-5.1.51]#cp /usr/local/mysql/share/mysql/my-medium /etc/my.cnf
[root@Linux mysql-5.1.51]#chown –R mysql /usr/local/mysql/var
[root@Linux mysql-5.1.51]#chgrp –R mysql /usr/local/mysql/.
[root@Linux mysql-5.1.51]#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
[root@Linux mysql-5.1.51]#chmod 755 /etc/init.d/mysql
[root@Linux mysql-5.1.51]#chkconfig –level 345 mysql on
[root@Linux mysql-5.1.51]#echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf
[root@Linux mysql-5.1.51]#echo “/usr/local/lib” >> /etc/ld.so.conf
[root@Linux mysql-5.1.51]#ldconfig
[root@Linux mysql-5.1.51]#ln –s /usr/local/mysql/lib/mysql /usr/lib/mysql
[root@Linux mysql-5.1.51]#ln –s /usr/local/mysql/include/mysql /usr/include/mysql
[root@Linux mysql-5.1.51]#service mysql start
[root@Linux mysql-5.1.51]#/usr/local/mysql/bin/mysqladmin –u root password $mysqlpass (这里填写你的mysql的密码)
[root@Linux mysql-5.1.51]#service mysql restart
[root@Linux mysql-5.1.51]#service mysql stop
[root@Linux mysql-5.1.51]#cd ../
安装Apache:
[root@Linux~]#tar zxvf httpd-2.2.17.tar.gz
[root@Linux~]#cd httpd-2.2.17/
[root@Linux httpd-2.2.17]#./configure --prefix=/usr/local/apache --enable-rewrite=shared --enable-so --enable-ssl --with-charset=UTF8 --disable-access --disable-auth --disable-charset-lite --disable-include --disable-log-config --disable-env --disable-setenvif --disable-mime --disable-status --disable-autoindex --disable-asis --disable-cgid --disable-cgi --disable-negotiation --disable-dir --disable-actions --disable-userdir --disable-alias --enable-so --enable-mods-shared='access auth auth_anon auth_dbm auth_digest dav dav_fs actions alias asis autoindex cache cern_meta cgi charset_lite deflate dir disk_cache env expires file_cache headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias'
[root@Linux httpd-2.2.17]#make && make install
[root@Linux httpd-2.2.17]#/usr/local/apache/bin/apachectl start
[root@Linux httpd-2.2.17]#cd ../
安装PHP:
修改httpd.conf 添加
AddType applications /x-httpd-php .php
AddType applications /x-httpd-source-php .phps
在DirectoryIndex 添加index.php
curl返回信息:
相关安全设置:
修改php.ini expose_php=off
disable_functions=symlink,shell_exec,exec,proc_close,proc_open,popen,
system,dl,passthru,escapeshellarg, escapeshellcmd
php安装测试未通过 undefined symbol: libiconv_open