php 安装

安装前.先安装些软件和库文件

yum install -y epel-release (有这个会安装所要安装包的依赖包,不会报任何错误,新手不建议)

yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libmcrypt-devel


tar zxf php-下载的包.tar.gz 

  cd php-解压目录

./configure   --prefix=/usr/local/php   --with-apxs2=/usr/local/apache2/bin/apxs   --with-config-file-path=/usr/local/php/etc   --with-mysql=/usr/local/mysql   --with-libxml-dir   --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir   --with-iconv-dir   --with-zlib-dir   --with-bz2   --with-openssl   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-mbstring   --enable-sockets   --enable-exif   --disable-ipv6 

                

 make

 make install


/bin/ls /usr/local/php/    可以看到目录

做一个php小脚本

   vi 1.php    (vi /usr/local/apache2/htdocs/1.php)

  写入

<?php

echo "localhost";

echo "\n";

?>        

执行 /usr/local/php/bin/php 1.php  执行脚本可以看到反馈信息 localhost


你可能感兴趣的:(PHP,详细,安装方法)