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

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

Jun 13, 2016 am 10:48 AM
apache mysql php download Prepare Bag Install method environment of detailed Configuration

安装前的准备:下载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 of this Website
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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1652
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

How to safely store JavaScript objects containing functions and regular expressions to a database and restore? How to safely store JavaScript objects containing functions and regular expressions to a database and restore? Apr 19, 2025 pm 11:09 PM

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

How to process and display percentage numbers in Java? How to process and display percentage numbers in Java? Apr 19, 2025 pm 10:48 PM

Display and processing of percentage numbers in Java In Java programming, the need to process and display percentage numbers is very common, for example, when processing Excel tables...

SQL vs. MySQL: Clarifying the Relationship Between the Two SQL vs. MySQL: Clarifying the Relationship Between the Two Apr 24, 2025 am 12:02 AM

SQL is a standard language for managing relational databases, while MySQL is a database management system that uses SQL. SQL defines ways to interact with a database, including CRUD operations, while MySQL implements the SQL standard and provides additional features such as stored procedures and triggers.

Compare and contrast MySQL and MariaDB. Compare and contrast MySQL and MariaDB. Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

How does MySQL differ from Oracle? How does MySQL differ from Oracle? Apr 22, 2025 pm 05:57 PM

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

See all articles