search
HomeBackend DevelopmentPHP ProblemHow to install mysql driver in php5

How to install mysql driver in php5

Nov 21, 2022 am 09:49 AM
mysqlphp

How to install the mysql driver in php5: 1. Download the "mysql-5.1.49-win32" version; 2. Find php.ini in the php installation directory; 3. Change ";extension=php_mysql.dll" Remove the semicolon before ";"; 4. Load the mysql module; 5. Restart apache.

How to install mysql driver in php5

#The operating environment of this tutorial: Windows7 system, PHP5 version, Dell G3 computer.

php5 How to install mysql driver?

apache php5 mysql installation method

The entire installation process is as follows:

1, first install apache: the version I installed is: httpd-2.2.16-win32 -x86-openssl-0.9.8o.msi

Website: http://www.apache.org/dist/httpd/binaries/win32/

apache installation and configuration went smoothly, nothing wrong Easy to say.

How to change the file path:

In the installation directory of the file, mine is: D:\Program Files\Apache Software Foundation\Apache2.2\conf, open httpd.conf search :DocumentRoot "C:/web/apache/htdocs" change the value to the publishing path you want, for example:

DocumentRoot "D:/WWW"

Then there is another place that is also needed Modify

Search: Directory "C:/web/apache/htdocs"

Modify to: Directory "D:/WWW"

This changes the release path of the file Go to d:www.

2, install PHP: Version: php-5.3.3-Win32-VC6-x86

Website: http://windows.php.net/download/

Unzip the downloaded compressed package to D:php, and rename php.ini-development in this directory to php.ini

Open php.ini and modify it as follows:

Search: error_reporting = E_ALL

Modification: error_reporting =E_ALL & ~E_NOTICE

This is to modify the error reporting level, E_ALL is to report all errors, and E_NOTICE is to report messages that should be paid attention to during runtime, such as initialized variables.

Search: extension_dir = "./"

Modify: extension_dir = "D:\php5\ext", configure the path of the extension library

Search:;extension=PHP_MySQL .dll, remove the preceding semicolon: extension=PHP_MySQL.dll

Search: ;extension=PHP_mysqli.dll Remove the preceding semicolon: extension=PHP_mysqli.dll

Search;session.save_path = "/tmp", change it to an existing path, session.save_path = "D:/mysql/session", or create a tmp folder in the release directory.

The basic settings of PHP are completed

3, configure apache to load PHP

Open the installation directory of apachede, mine is: D:\Program Files\Apache Software Foundation\Apache2. 2\conf\extra, create a new text file named: httpd-php5.conf, open it and add the following content

view sourceprint?LoadModule php5_module "C:\web\php\php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php
PHPIniDir "C:\web\php"

Then open: C:\web\apache\conf\httpd.conf, at the end of the file Add a line:

Include conf/extra/httpd-php5.conf

Restart Apache, open the directory: D:\WWW, create a new file: index.php, enter the content:

phpinfo();
?>

Use a browser to open http://localhost, test Whether the installation is successful

Step 4: Install mysql: version mysql-5.1.49-win32

Website: http://dev.mysql.com/downloads/mysql/#downloads

There is a configuration wizard after installation. There is no strict set of options. You can just set them according to your own needs. It will have little impact.

Combined with Apache and php, as mentioned before, let me talk about it again, find php.ini in the php installation directory, remove the ";" before ";extension=php_mysql.dll", and load mysql module. Save, close, and restart apache.

Step 5: Install phpMyAdmin

I downloaded it from Huajun Software: http://www.onlinedown.net/soft/2616.htm

Unzip and publish directory, which is the D:\WWW set up earlier; change config.default.php

under the \libraries folder and make the following modifications:

1 Find the password and have the following two lines

$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['password'] = '' ;

Fill your mysql password into $cfg['Servers'][$i]['password'] = ''; inside the single quotes

2 Search $cfg['PmaAbsoluteUri '], set it to the phpMyAdmin directory path, such as: http://localhost/phpMyAdmin/

I don’t know if the above method is necessary, because it can run after I changed it back later.

Summary of problems encountered during the configuration process:

1. The installation of mysql failed.

The general situation is that the previous Mysql uninstallation was incomplete. How can I cleanly uninstall mysql? In a DOS environment

1, first stop the mysql service: Stop Mysql: net stop mysql, or you can right-click "My Computer" - Management - Services - Find the mysql service , and then stop.

2, uninstall c:\mysql\bin\mysqld-nt under DOS --remove

//c:\mysql\bin\ is the specific path. If you want to completely delete mysql, first End the mysql process and then uninstall mysql.

The two additional DOS instructions are:

Start Mysql: net start mysql

Installation: c:\mysql\bin\mysqld --install //Pay attention to modifications Specific path

3, delete the remaining mysql files directly.

If you accidentally deleted all mysql files and did not perform the above uninstall function before, you can use the following method:

1, stop the mysql service, the same as above 1.

2, manual deletion requires refreshing to execute if you need to introduce external Js]

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to install mysql driver in php5. For more information, please follow other related articles on the PHP Chinese website!

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
ACID vs BASE Database: Differences and when to use each.ACID vs BASE Database: Differences and when to use each.Mar 26, 2025 pm 04:19 PM

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

PHP Secure File Uploads: Preventing file-related vulnerabilities.PHP Secure File Uploads: Preventing file-related vulnerabilities.Mar 26, 2025 pm 04:18 PM

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

PHP Input Validation: Best practices.PHP Input Validation: Best practices.Mar 26, 2025 pm 04:17 PM

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

PHP API Rate Limiting: Implementation strategies.PHP API Rate Limiting: Implementation strategies.Mar 26, 2025 pm 04:16 PM

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

PHP Password Hashing: password_hash and password_verify.PHP Password Hashing: password_hash and password_verify.Mar 26, 2025 pm 04:15 PM

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

OWASP Top 10 PHP: Describe and mitigate common vulnerabilities.OWASP Top 10 PHP: Describe and mitigate common vulnerabilities.Mar 26, 2025 pm 04:13 PM

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP XSS Prevention: How to protect against XSS.PHP XSS Prevention: How to protect against XSS.Mar 26, 2025 pm 04:12 PM

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

PHP Interface vs Abstract Class: When to use each.PHP Interface vs Abstract Class: When to use each.Mar 26, 2025 pm 04:11 PM

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct

See all articles

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

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

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.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor