windows下PHP 连接不上MYSQL的解决方法
烈火建站学院(Bkjia.Com)文档 PHP连接不上MYSQL.测试连接mysql 提示'Fatal error: Call to undefined function mysql_connect()"环境j是:windows xp sp2 en , apache2.2,mysql5.1rc.php5.28。
按网易科技的配置教程配置完成后.用phpinfo()查看.没有发现mysql...,但dos窗口中是可以正常操作mysql的.然后.就来回的看看是那里的问题.
在这个网页中http://www.somacon.com/p109.php的所有方法也是
接着看日志.重装..反复设置php.ini,my.ini,apache.conf,结果还是没追上她..我的脑子真的好难转弯.后来实在是没有什么方法了...就直接用adminphp来看看能不能连上,但提示"Cannot load mysql extension. Please check your PHP configuration".感觉我就是 Mr. bean
这个提示,会不会是php没有加载到连接mysql的库文件呢? 在启动apache server后.我试着删除'php5ts.dll'和'libmysql.dll'.提示不能删除.说明有程序在用着这两个库文件.说明是有加载的.(当然有许多方法来测试.比如可以用一些软件,查看程序服务加载的所有库文件.也是可以然而ap也说指是php.ini设置有问题.那我就不看别的.我就重点针对php.ini配置.
在没有迷信php.ini是正确下.终于发现.php.ini中漏了这一行.
PHPIniDir "你的php目录"
#(例如: PHPIniDir "c:/php")
重启apache server,然后.用网上常用的方法
以下为引用的内容: $link=mysql_connect('localhost','用户名','password'); if(!$link) echo "失败!"; else echo "成功!"; mysql_close(); ?> |
测试一下.就可以了。我的php.ini配置
就是这样,花了不少时间了..我也是第一次撞到这个问题.只能说明"缘分''都是"缘分"啊!
注意:
同一机器上。如果以前多次安装过.apache.或者安装不是在同一目录.而且不只一个版本.在安装mysql5.1rc前。最好清理一下注册表
一些别的配置教程.说要复制2个dll文件到system32,其实,按以上163的教程.因为设置了环境变量.,所以就不须要了。如果你以前有复制过.就删除他吧.
以下为引用的内容: en version: problem: if something wrong with 'Fatal error: Call to undefined function mysql_connect()...' or 'Cannot load mysql extension. Please check your PHP configuration' while your test resolve: add new line like : PHPIniDir "#your php root fold" (e.g: PHPIniDir "c:/php") in php.ini file restart servers see.ok if unlock its again. link bellow : http://www.somacon.com/p109.php |

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

AI Hentai Generator
Generate AI Hentai for free.

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

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.
