PHP环境(apache,PHP,Mysql)详细配置方法
安装前的准备:下载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的专栏

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











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.

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.

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

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.

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 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.

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.

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.
