luoson1 发表于 2018-11-25 10:54:47

centos 5.8 64位 安装apache+mysql+php 笔记

  centos 5.8 64位 安装apache+mysql+php 笔记
  安装环境我在apachet 和mysql中有说。
apache和mysql的安装我在以前的笔记中有,大家找找吧,我这里就不说了哦~~!
  apache的版本:
#/usr/local/apache2/bin/httpd -v
Server version: Apache/2.2.23 (Unix)
Server built:   Nov3 2012 17:09:28
  查看apache已编译安装的模块
# /usr/local/apache2/bin/httpd -M
Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
cache_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
setenvif_module (static)
version_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
rewrite_module (static)
so_module (static)
php5_module (shared)
Syntax OK
#
  安装php依赖包libmcrypt
# cd libmcrypt-2.5.8
# ./configure
# make && make install
  安装相关资源及图片依赖包
# yum install bzip2 bzip2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype-devel -y
  
第一步: 下载PHP我直接下载到/ROOT目录中
  # ll |grep php
-rw-r--r--1 rootroot11040787 09-14 09:53 php-5.4.7.tar.bz2
  第二步:解压PHP
# tar jxvf php-5.4.7.tar.bz2
# cd php-5.4.7
  
第二步:配置PHP
#./configure --prefix=/usr/local/php5 --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-config-file-path=/usr/local/php5
  我里我说明一下:
php的安装目录:/usr/local/php5
apache的安装目录:/usr/local/apache2
mysql的安装目录:/usr/local/mysql/
php的配置文件目录:/usr/local/php5
  
第三步:编译安装
# make && make install
  php配置,编译安装时我的php.ini文件目录指向/usr/local/apache/conf   建配置文件
#cp /root/php-5.4.7/php.ini-production /usr/local/php5/php.ini
  第四步:配置
  apache配置文件httpd.conf相关修改:
  1:添加默认索引页面index.php,再找到“DirectoryIndex”,在index.html后面加上“ index.php”
    DirectoryIndex index.html index.php index.jsp
2:添加php支持,在末尾处加下如下代码
    # php_module Configuration
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps
    PHPIniDir "conf"
3:开启Apache支持伪静态,找到“AllowOverride None”,修改为
    AllowOverride All
  第五步:添加测试叶
  # vi /usr/local/apache2/htdocs/index.php
  
  加入以上这些。保存退出。
  第六步:验证
  打开IE   http://192.168.1.110/index.php
  就说到这里了~~!
  phpize的安装
有yum命令就行。phpize是属于php-devel的内容
  yum install php-devel
搞定



页: [1]
查看完整版本: centos 5.8 64位 安装apache+mysql+php 笔记