search
Homephp教程php手册PHP环境(apache,PHP,Mysql)详细配置方法

PHP环境(apache,PHP,Mysql)详细配置方法

Jun 13, 2016 am 10:48 AM
apachemysqlphpdownloadPrepareBagInstallmethodenvironmentofdetailedConfiguration

安装前的准备:下载PHP,apache,mysql安装包,可以到相关官网上下载,下面是安装步骤
1.安装Apache ,直接运行安装即可,我们将其安装到D:/PHP/Apache/ 目录下
2.将PHP压缩包解压内容放到指定PHP 目录(自己指定这里是D:/PHP/,并重命名为PHP5)
3.修改Apache配置文件
     1.加载PHP模块  在Apache配置文件 添加
LoadModule php5_module"D:/PHP/PHP5/php5apache2_2.dll"  //D:/PHP/PHP5/为php安装目录
     2.  添加AddTypeapplication/x-httpd-php .php .phtml  //设置apache解 文件类型
//指定php配置文件路径
     添加phpinidir "D:/PHP/PHP5"  设置php配置文件目录(先将PHP安装目录 中的PHP.iniDevelopment重命名为php.ini)
4.重启Apache
5.验证PHP是否安装成功
这里我们在D:\PHP\Apache\htdocs目录下创建一个phpinfo.php文件输入以下内容
[php] view plaincopy
    phpinfo(); 
?> 
然后打开浏览器输入http://localhost/phpinfo.php  ,默认的是80端口,如果不是80端口localhost后面必须加端口号,如果安装成功,则打开PHP相关信息页面,否则检查相关目录是否安装正确
6.安装mysql服务,直接运行mysql安装文件,按照提示一步一步的执行安装操作
5添加Mysql模块
1.在PHP安装目录找到libMysql.dll 或phpmysql.dll 和 phpmysqli.dll 复制到C盘Windows目录下
2.打开PHP配置文件
1.取消extension=php_mysql.dll和extension=php_mysqli.dll前面分号去掉
2.在php.ini中设置扩展路径extension_dir="D:/PHP/PHP5/ext"
3.重启Apache
4.在浏览器再次访问phpinfo.php页面,如果页面信息多了mysql和mysqli列表示添加模块成功,否则重新检查上述步骤
验证mysql是否



摘自 jt521xlg的专栏

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.