PHP无法正确载入Mysql库,
PHP无法正确载入Mysql库,求助各位高手!!!
各软件版本:
apache:2.2.22
PHP:5.2.17
Mysql:5.5.23
现在apache已经能正常解析.php文件,但phpinfo()却一直无法正确显示载入了mysql库。
我的php.ini放在php的安装路径,配置有:
extension_dir = "./ext"
extension=php_mysql.dll
./ext里确实有php_mysql.dll文件。
后来我上网查,说是要在system32中也放入php_mysql.dll文件,然后我也复制了一份过去,但还是不行。
小弟新手,以前都是用的AppServ,第一次自己安,弄半天都没弄好,请各位高手帮帮忙!不甚感激!!!
------解决方案--------------------
检查一下phpinfo内的 php.ini路径是不是你修改的这个.另外不仅仅是php_mysql.dll需要复制好像还有个libmysql.dll
也是需要复制到system32下的.试一下看看. win下配置环境我也变得很陌生了...
------解决方案--------------------
在 window 环境中
1、不要复制任何文件(绿色安装)
因为 apache、php、mysql 都可以不依赖注册表运行
2、模块方式的 php 的 extension_dir 应使用绝对路径(可不要盘符),相对路径 ./ext 是给 php.exe 用的
否则驻留在内存中的 php5apache2_2.dll 将找不到相应的目录,无法指示 php5ts.dll 加载扩展库
3、apache 配置 php 的基本参数(替换路径为你真实路径)
PHPIniDir "/AMP/php536"
LoadFile "/AMP/php536/php5ts.dll"
LoadModule php5_module "/AMP/php536/php5apache2_2.dll"
addtype application/x-httpd-php .php
4、备用知识:
设
apache 被安装于 /AMP/apache2 下
mysql 被安装与 /AMP/mysql 下
那么将 /AMP 复制到U盘上就可使环境变成便携的了
启动时执行
start /B "Apache" "\AMP\apache2\bin\httpd.exe"
start /B "Mysql" "\AMP\mysql\bin\mysqld.exe" --defaults-file="\AMP\mysql\my.ini"
停止时执行
tskill httpd
tskill mysqld

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

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

The core benefits of PHP include ease of learning, strong web development support, rich libraries and frameworks, high performance and scalability, cross-platform compatibility, and cost-effectiveness. 1) Easy to learn and use, suitable for beginners; 2) Good integration with web servers and supports multiple databases; 3) Have powerful frameworks such as Laravel; 4) High performance can be achieved through optimization; 5) Support multiple operating systems; 6) Open source to reduce development costs.

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

PHP is suitable for web development and content management systems, and Python is suitable for data science, machine learning and automation scripts. 1.PHP performs well in building fast and scalable websites and applications and is commonly used in CMS such as WordPress. 2. Python has performed outstandingly in the fields of data science and machine learning, with rich libraries such as NumPy and TensorFlow.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.
