centos6.3_x64
nginx-1.2.8
php-5.3.23
mysql-5.6.10
未fastcgi、memcache等优化
,另外,因为8万字符的原因,错误截图未能放上来,尽量在下次把错误代码发上来
yum install autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml* zlib* glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers libxslt-devel gd gd-devel libtool-ltdl-devel* pcre-devel mysql-devel
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13
./configure --prefix=/usr/local/
make
make install
cd ..
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
ldconfig
cd ..
tar zxvf cmake-2.8.10.2.tar.gz
cd cmake-2.8.10.2
./configure
make
make install
cd ..
groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
tar zxvf mysql-5.6.10.tar.gz
cd mysql-5.6.10
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_SSL=bundled -DWITH_SSL=system -DCURSES_LIBRARY=/usr/lib64/libncurses.so -DCURSES_INCLUDE_PATH=/usr/include
make
make install
cd /usr/local/mysql/
chown -R mysql:mysql .
cd mysql-5.6.10/support-files/
cp my-default.cnf /etc/my.cnf
cp mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cd /usr/local/mysql/
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
/etc/init.d/mysqld restart
echo "/usr/local/mysql/lib/" >> /etc/ld.so.conf
ldconfig
echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
mysql
show variables like '%character%';
tar zxvf php-5.3.23.tar.gz
cd php-5.3.23
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/ --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-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --enable-sockets --enable-zip --without-pear --enable-pdo --with-pdo-mysql
第一个错误和解决方法
ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/ --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-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --enable-sockets --enable-zip --without-pear --enable-pdo --with-pdo-mysql
标红的地方不管怎么样都得这么改,我很不理解这样就能通过了
第二个错误和解决方法
yum install mysql-devel
第三个错误的地方和解决方法,错误地方在--disable-rpath参数,
export LD_LIBRARY_PATH=/lib/:/usr/lib/:/usr/local/lib
第四个错误及解决办法
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-production /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
vim /usr/local/php/etc/php-fpm.conf
启用如下选项:
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
pm.max_requests = 1024
pid = run/php-fpm.pid
/usr/local/php/sbin/php-fpm -t
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
cd ..
tar zxvf pcre-8.10.tar.gz
cd pcre-8.10
./configure
make
cd ..
tar zxvf openssl-1.0.0e.tar.gz
cd openssl-1.0.0e
./config
make
cd ..
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
cd ..
tar zxvf nginx-1.2.8.tar.gz
cd nginx-1.2.8
./configure --prefix=/usr/local/nginx --with-openssl=/root/src/openssl-1.0.0e --with-http_stub_status_module --with-http_ssl_module --with-zlib=/root/src/zlib-1.2.3 --with-pcre
make
make install
cd ..
cd php-5.3.23/ext/pdo_mysql/
/usr/local/php/bin/phpize #测试
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql/
make
make install
vim /usr/local/php/etc/php.ini
找到extension_dir = "./"改成下面,并增加第2行
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
extension = "pdo_mysql.so"
vim /usr/local/nginx/conf/nginx.conf
user nobody;
worker_processes 1;
events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .*\.(php|php5)?$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
}
}
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/etc/init.d/php-fpm start
nginx php mysql配置完成,优化下次
本文出自 “牛在天上飞” 博客,谢绝转载!