zoukankan      html  css  js  c++  java
  • win10本地搭建apache+php+mysql运行环境

    首先下载所需软件:

    Vc2015:https://www.microsoft.com/zh-CN/download/details.aspx?id=48145

    Vc2012:http://www.microsoft.com/zh-CN/download/details.aspx?id=30679

    Apache2.4:http://www.apachelounge.com/download

    PHP:http://windows.php.net/download (下载线程安全版的,即Thread Safe)

    Mysql:https://www.mysql.com/downloads

    安装并配置Apache

    Apache版本:Apache2.4.16

    解压目录:D:PHPApache24

    安装Apache2.4.16,vc14版本的,需要先安装Visual C++ Redistributable for Visual Studio 2015运行库;vc11版本的,需要先安装Visual C++ Redistributable for Visual Studio 2012运行库

    (1).下载回来的是解压文件,解压好放到要安装的位置。

    (2).打开Apache24conf下httpd.conf 文件,修改以下关键位置:

    ServerRoot  “D:/PHP/Apache24”(即Apache的安装位置);

    DocumentRoot  “D:/PHP/Apache24/htdocs” (Apache默认的网站根目录,可根据自己的   喜好调整)

    修改根目录的选项:

    修改前

    <Directory "c:/Apache24/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride null
        Require all granted
    </Directory>

    修改后

    <Directory "D:/PHP/Apache24/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    #ServerName www.example.com:80 => ServerName 127.0.0.1:80 (去掉前面的#)

    DirectoryIndex index.html => DirectoryIndex index.html index.php index.htm (我们添加了  index.php index.htm)

    ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"改为

    ScriptAlias /cgi-bin/ "d:/PHP/Apache24/cgi-bin/"

    <Directory "c:/Apache24/cgi-bin"> => <Directory "d:/PHP/Apache24/cgi-bin">

    (3).打开cmd,并输入以下命令行

    d: 回车

    cd PHPApache24in 调到Apache24中bin目录下

    httpd 回车 如果没有任何提示表示启动成功

    如果想在服务中添加Apache24,则以管理员身份 运行cmd,并输入以下命令

    d: 回车

    cd PHPApache24in 回车

    httpd.exe -k install 回车

    (4).打开浏览器输入“http://localhost/”进行测试,显示”It works!”证明配置成功。

    安装并配置PHP

    PHP版本:php5.6.14

    安装目录:D:PHPphp56

    安装php5.6.14需要先安装Visual C++ Redistributable for Visual Studio 2012运行库

    (1).下载回来的是解压文件,解压好放到要安装的位置;

    (2).复制份php.ini-development,并改名为php.ini

    (3).让Apache24加载PHP模块,打开Apache24confhttpd.conf,在最后加上

    LoadModule php5_module "D:/PHP/php56/php5apache2_4.dll"

    AddType application/x-httpd-php .php .html .htm

    PHPIniDir "D:/PHP/php56" (告诉apache php.ini的位置)

    (4).开启几个常用php扩展(根据需求自行选择),打开php.ini文件,修改以下内容:

    ;extension_dir = "ext" => extension_dir = "D:/PHP/php56/ext"(去掉分号)

    ;extension=php_mbstring.dll => extension=php_mbstring.dll

    ;extension=php_mysql.dll => extension=php_mysql.dll

    ;extension=php_mysqli.dll => extension=php_mysqli.dll

    注意:win下要开启curl扩展,libeay32.dll和ssleay32.dll必须放到PATH环境变量包含的目录下   

    (5).重启Apache服务器

    安装Mysql

    Mysql版本:mysql5.6.27

    点击文件直接安装即可。

  • 相关阅读:
    PHP 上传文件 function move_uploaded_file: failed to open stream
    python super() 方法使用
    python 负数转为无符号整数
    python Aes 加密 解密
    mongoDB 启动 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
    ansible使用
    字段类型binary
    7-14 求整数段和
    7-13 日K蜡烛图
    7-12 两个数的简单计算器
  • 原文地址:https://www.cnblogs.com/sq45711478/p/6368833.html
Copyright © 2011-2022 走看看