PHP Apache Mysql的配置搭建及多站点配置
以php5.4,apache2.4,mysql5.7为例
一,apache的配置:
1,找到配置文件apache目录下conf->httpd文件。
2,配置文件
根目录配置:
Define SRVROOT "D:/x64"
ServerRoot "${SRVROOT}"
或者ServerRoot "文件目录“
端口配置:
Listen 80
加载PHP文件配置:
#LoadModule xml2enc_module modules/mod_xml2enc.so
后面一行加上LoadModule php5_module "c:/www/php54/php5apache2_2.dll(文件目录下的php5apache2_2(2_4).dll路径)"
运行文件存放目录:
DocumentRoot "文件目录"
*权限目录:
<Directory "文件目录">此处的文件目录大于等于文件存放目录。
入口文件设置:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
PHP解释配置:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz后面一行加上 AddType application/x-httpd-php .php来解析php文件
指定PHP配置文件:
PHPIniDir "php配置文件目录" 例如D:/php54/php.ini就是 PHPIniDir "D:/php54"
介绍:
错误日志:ErrorLog "logs/error.log"
访问日志: CustomLog "logs/access.log" common
错误提示区:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
3,虚拟主机多站点配置
首先,conf->httpd文件中加载:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
然后,在conf/extra/httpd-vhosts.conf文件中:
# Add any other Virtual Hosts below#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot "${SRVROOT}/docs/dummy-host.example.com"
# ServerName dummy-host.example.com
# ServerAlias www.dummy-host.example.com
# ErrorLog "logs/dummy-host.example.com-error.log"
# CustomLog "logs/dummy-host.example.com-access.log" common
#</VirtualHost>#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host2.example.com
# DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
# ServerName dummy-host2.example.com
# ErrorLog "logs/dummy-host2.example.com-error.log"
# CustomLog "logs/dummy-host2.example.com-access.log" common
#</VirtualHost> 此处为添加站点处
将其改为
<VirtualHost *:80>ServerAdmin webmaster@dummy-host2.example.comDocumentRoot "你的文件地址"ServerName 域名你的(127.0.0.2)ErrorLog "logs/dummy-host2.example.com-error.log"CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
二,数据库配置:
1,配置文件复制更名为my.ini
打开my.ini并配置
[mysql]default-character-set=utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin# These are commonly set, remove the # and set as required.basedir = D:/mysql-5.7.11-winx64datadir = D:/mysql-5.7.11-winx64/Dataport = 3306character_set_server=utf8
# server_id = .....
2,配置环境变量:
” 我的电脑“ 右击 “属性”->高级->环境变量->系统变量->Path 编辑(在path最后以;隔开加入你的路径D:\mysql-5.7.11-winx64)确定即可
3,以管理员身份运行cmd(C:/windows/system32/cmd.exe右击管理员运行)依次键入
cd D:
cd D:\mysql-5.7.11-winx64\bin
mysqld --initialize-insecure
mysqld -install
4,启动服务器 net start mysql
5,进入数据库 mysql -uroot -p(两次回车)
6设置密码set password for root @localhost=password("your password');
三,PHP配置
php.ini文件中去掉extension=php_mysql.dll前面的“;”即可
PHP Apache Mysql的配置搭建及多站点配置相关推荐
- SSM+nginx+tomcat+maven+mysql+redis环境搭建及工程全套配置,实现前后端动静分离
目录 前言 服务器环境搭建 windows开发环境 SSM搭建 加入redis(注解形式) nginx与tomcat关联配置,完成前后端连接 前言 本次采用前后端分离模式,前端以html.css.js ...
- ubuntu lamp(apache+mysql+php) 环境搭建及相关扩展更新
一.环境安装 1.安装apache2 sudo apt-get install apache2 安装后在浏览器中打开:http://localhost/或者http://127.0.0.1 如果出现I ...
- PHP5.4 Apache Mysql搭配与多站点配置
PHP5.4 Apache Mysql搭配与多站点配置 一.PHP5.4环境搭配基本流程. 1.文件准备 httpd-2.2.21-win32-x86-openssl-0.9.8r.msihttp:/ ...
- mysql集群搭建(使用docker 一主一从)
mysql集群搭建 my.cnf 配置文件配置 在 /etc/mysql/my.cnf 中 (拿一个举例) (docker中需要先进入开启的容器,docker exec -it 容器名称 /bin/b ...
- PHP环境搭建:Windows 7下安装配置PHP+Apache+Mysql环境教程(转)
转至:http://www.leapsoul.cn/?p=695 这两天刚装好Windows 7,碰巧前段时间有朋友问我Windows下如何安装搭建PHP环境,所以打算勤劳下,手动一步步搭建PHP环境 ...
- PHP环境搭建:Windows 7下安装配置PHP+Apache+Mysql环境教程
来源:http://www.leapsoul.cn/?p=695 这两天刚装好Windows 7,碰巧前段时间有朋友问我Windows下如何安装搭建PHP环境,所以打算勤劳下,手动一步步搭建PHP环境 ...
- LAMP(Linux+Apache+MySQL+PHP)环境介绍、配置、搭建
文章目录 写在开头的话 LAMP的简要介绍 部署方式 LAMP环境搭建 环境准备 准备本地yum源 安装编译文件 关闭防火墙和SElinux 环境搭建 安装依赖包 安装 Apache 安装mysql ...
- redmine mysql配置_Redmine安装指南一:railsinstaller+apache+mysql(推荐)
安装方法一:railsinstaller+apache+mysql 搜索redmine安装的时候,排名最前配置ruby环境的软件就是InstantRails.可实际上InstantRails从2007 ...
- centos安装php服务器,在CentOS上安装搭建PHP+Apache+Mysql的服务器环境方法
以下安装过程是基于centos下,使用yum安装搭建PHP+Apache+Mysql的服务器环境 一:安装MySQL 1.安装yum install mysql mysql-server mysql- ...
最新文章
- 持续集成之“自动化部署”
- C#选择目录对话框FolderBrowserDialog
- python正态分布相关函数
- O_RDWR, O_CREAT等open函数标志位在哪里定义?
- CAS 4.1.x 单点登出(退出登录)的原理解析
- Xcode的插件的路径
- 谷歌语法(详解+举例)
- 汇编语言 大小比较 理解 ja jna jg jle
- 后分布式时代: 多数派读写的「少数派」实现
- 学会使用Composer
- Java学习——类和对象(上)
- C语言项目 - 有理数类型
- shell脚本之遍历字符串数组
- 软件——Jira是什么
- Typora更新版本后要收费
- 微信公众平台网页授权
- 易语言 python库_精易Python支持库 (1.1#1205版)发布啦!
- 数据库中表的常见七大约束
- javassist编程指南(一)
- 如何有效安排工作的内容