centos6.5安装php

一、安装php前准备:

rpm -qa zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel openssl-devel libxslt-devel

mysql,apache,libiconv需要源码安装



二、编译参数

./configure \

--prefix=/application/php-5.6.13 \

--with-apxs2=/application/apache/bin/apxs \

--with-mysql=/usr/local/mysql \

--with-xmlrpc \

--with-openssl \

--with-zlib \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-iconv=/application/libiconv-1.14 \

--enable-short-tags \

--enable-sockets \

--enable-soap \

--enable-mbstring \

--enable-static \

--enable-gd-native-ttf \

--with-curl \

--with-xsl \

--enable-ftp \

--with-libxml-dir


三、make && make install


四、配置修改

ln -s /application/php5.3.10 /application/php

cp php.ini-production /application/php/lib/php.ini

修改httpd.conf

grep php conf/httpd.conf

LoadModule php5_module        modules/libphp5.so

    DirectoryIndex index.php index.html

    AddType application/x-httpd-php .php .phtml

    AddType application/x-httpd-php-source  .phps

./bin/apachectl -t

Syntax OK

./bin/apachectl graceful


httpd.conf里关于htdocs权限

Order allow,deny

Allow from all


你可能感兴趣的:(PHP,centos)