Linux--LAMP平台搭建


LAMP平台搭建

准备工作
rpm -e php php-cli php-ldap php-commn php-mysql --nodeps
删除php相关依赖软件
rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm
rpm -ivh libxm12-devel-2.7.6-14.el6.x86_64.rpm
安装两个相关软件
 
安装apache和mysql服务
详情请看前面
安装扩展工具库
tar zxvf libmcrypt-2.5.8.tar.gz
tar zxvf mhash-0.9.9.9.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
编译安装php
tar zxvf php-5.3.28.tar.gz
./configure --prefix=/usr/local/php5  --with-mcrypt  --with-apxs2=/usr/local/httpd/bin/apxs
--with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php5 --enable-mbstring
配置php
cp /usr/src/php-5.3.28/php.ini-development /usr/local/php5/php.ini
default_charset="utf-8" //设置默认字符集
file_uploads=on //允许通过PHP网页上传文件
upload_max_filesize=2M //允许上传的文件大小设置
max_file_uploads=20 //每个HTTP最多允许请求上传的文件数
post_max_size=8M //每次通过表单post提交的 数据量限制
short_open_tag=on //允许识别php短语法标记
添加ZendGuardLoader优化模块
tar zxvf ZendGUrdLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cp ZendGUrdLoader-php-5.3-linux-glibc23-x86_64/php.5.3.x/ZendGUrdLoade.so  /usr/local/php5/libphp
vi /usr/local/php5/php.ini
zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so
zend_loader.enable=1
httpd.conf调整
vi /usr/local/httpd/con/http.conf
LoadModule php5_module modules/libphp5.so
AddTtpe application/x-httpd-php .php
DirectoryIndex index.php index.html
 
   PS:蓝色为修改部分,红色为添加部分
 

原文地址:https://www.cnblogs.com/wazy/p/7717313.html