Centos编译安装PHP.doc
文本预览下载声明
# echo /usr/local/mysql/lib /etc/ld.so.conf.d/mysql.conf
# ldconfig
# tar xf libmcrypt-2.5.8.tar.gz?
# cd libmcrypt-2.5.8
# ./configure
# make make install
# /sbin/ldconfig
# cd libltdl/
# ./configure --enable-ltdl-install
# make make install
# cd ../..
# 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
# tar xf php-5.4.11.tar.gz?
#?cd php-5.4.11
# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem ?--with-curl ?--enable-mbstring --with-mcrypt ?--with-gd ?--with-openssl --without-pear
# make make install
# cp php.ini-production /usr/local/php/etc/php.ini
# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# chmod +x /etc/init.d/php-fpm
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
#修改nginx 配置
? ? ? ? location / {
? ? ? ? ? ? root ? /home/www;
? ? ? ? ? ? index ?index.html index.htm index.php; ? ?#加一个index.php
? ? ? ? }
? ? ? ? location ~ \.php$ {
? ? ? ? ? ? root ? ? ? ? ? /home/www; ? ? #修改成web目录
? ? ? ? ? ? fastcgi_pass ? :9000;
? ? ? ? ? ? fastcgi_index ?index.php;
? ? ? ? ? ? fastcgi_param ?SCRIPT_FILENAME ?$document_root$fastcgi_script_name; ? #这里也要改成$document_root
? ? ? ? ? ? include ? ? ? ?fastcgi_params;
? ? ? ? }
重启nginx
# /usr/local/nginx/sbin/nginx -s reload
# /usr/local/php/sbin/php-fpm -t 测试php配置文件
测试
启动PHP:?
#/etc/init.d/php-fpm start
#vi /etc/rc.local
添加
?#/etc/init.d/php-fpm start
vi /home/www/index.
显示全部