什么是LAMP

  • 目前最为成熟的一种企业网站应用模式,可提供动态Web站点应用及开发环境

构成组件

  • Linux、Apache、MySQL、PHP/Perl/Python

LAMP的优势

  • 成本低廉

  • 可定制、易于开发

  • 方便易用、安全和稳定


实验案例:构建LAMP应用系统

需求描述

  • 构建LAMP网站平台

  • 安装并配置phpMyAdmin系统

实现思路

  • 构建PHP运行环境

  • 创建数据库并授权

  • 安装并验证phpMyAdmin系统


之前已经搭建好了apache和mysql,下面开始php的安装

先安装数据加密等扩展工具(如libmcrypt、mhash、mcrypt)

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


libmcrypt的配置、编译、安装、优化路径

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


mhash的配置、编译、安装、优化路径

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


mcrypt的配置、编译、安装

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


解压PHP软件包

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


配置PHP

  • --prefix 指定安装目录

  • --with-mcrypt 加载数据加密等扩展工具支持

  • --with-apxs2 设置"apache http server"提供的apxs模块支持程序的位置

  • --with-mysql 设置MYSQL数据库服务程序的安装位置

  • --with-config-file-path 设置PHP的配置文件php.ini将要存放的位置

  • --enable-mbstring 启用多字节字符串功能

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


编译及安装

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


建立php.ini文件

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


修改php.ini文件

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统设置默认字符集为utf-8

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统允许通过PHP网页上传文件

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统允许上传的文件大小限制

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统每个HTTP请求最多允许上传的文件数

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统每次通过表单POST提交的数据量限制

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统允许识别PHP短语法标记,即<? ... ?>


添加ZendGuardLoader优化模块

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


调整httpd.conf配置文件.支持PHP页面解析

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


测试PHP网页能否正确显示

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


测试PHP网页能否访问MYSQL数据库

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


部署phpMyAdmin系统

解包并复制到网站根目录

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


建立配置文件config.inc.ph

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


MYSQL数据库中添加elcdb库和elcadmin用户

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


登录phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


创建新的表

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


表及数据记录的管理

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统


导出SQL脚本文件

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

LAMP平台部署及应用(一) -- PHP的安装及配置和phpMyAdmin系统

转载于:https://blog.51cto.com/stevensj/1311230

相关文章:

  • 2021-10-02
  • 2021-12-29
  • 2022-12-23
  • 2022-01-03
  • 2021-05-04
  • 2021-08-04
  • 2021-07-17
猜你喜欢
  • 2021-12-26
相关资源
相似解决方案