LAMP-PHP安装全步骤
—————————————————安装包下载链接———————————————————————–
http://pan.baidu.com/s/1hsL4yfM 密码:68nw
—————————————————使用mcrypt模块功能—————————————————————–
1.先安装Libmcrypt
#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make install 说明:libmcript默认安装在/usr/local
2、安装mhash
#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./configure
#make
#make install
3、安装mcrypt
#tar -zxvf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#LD_LIBRARY_PATH=/usr/local/lib ./configure
报错 Cannot find libmysqlclient_r under /usr/local/mysql. Note that the MySQL client library is not bundled anymore
# cd /usr/local/mysql/lib/mysql/
#ln -s libmysqlclient.so.20.3.4 libmysqlclient_r.so
#make
#make install
———————————————————————————————————————————————
——————————————————PHP安装—————————————————————————
#./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –with-openssl –with-mysqli=/usr/local/mysql/bin/mysql_config –enable-mbstring –with-freetype-dir –with-jpeg-dir –with-zlib –with-libxml-dir=/usr –enable-xml –enable-sockets –with-apxs2=/usr/local/apache/bin/apxs –with-mcrypt –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –with-bz2 –enable-maintainer-ztske
#make install
——————————————————————————————————————————————–
——————————————————–PHP配制文件——————————————————————
——————————————————————————————————————————————–
——————————————————apache 和php 结合————————————————————
#vim /etc/httpd/http.conf
查询/AddType
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phps
查找/DirectoryIndex
index.php
——————————————————————————————————————————————-
——————————————————-配制PHP————————————————————————
#httpd -M 查看使用的模块
#vim /etc/httpd/httpd.conf
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
———————————————————————————————————————————————
——————————————————测试PHP—————————————————————————
phpinfo();
?>
测试与mysql的连接:wq
<?php
$conn=mysql_connct(,localhost\’,root\’,\’\’);
if ($conn)//
echo “链接“”;
else
echo “shibai”;
?>
——————————————————————————————————————————————
————————————–xcache——————————————————————————————
xcache 是 PHP的扩展
安装方法: #/usr/local/php/bin/phpize 额外安装的扩展都需要运行phpize命令,在扩展文件夹中运行
报错:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
#yum install autoconf -y 安装
# ./configure –enable-xcache –with-php-config=/usr/local/php/bin/php-config
#make
#make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ xcache安装路径
#mkdir /etc/php.d
#cp xcache.ini /etc/php.d/
#vim /etc/php.d/xcache.ini
zend_extension = /usr/local/php/lib/php/extensions/no-debug-zts-20131226/xcache.so
————————————————————————————————————————————–