windows 如何让 PHP 与 ADOdb 和 MySQL 一起工作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/155308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I get PHP to work with ADOdb and MySQL?
提问by Zack Peterson
I'm trying to get a PHP site working in IIS on Windows Server with MySQL.
我正在尝试使用 MySQL 在 Windows Server 上的 IIS 中运行 PHP 站点。
I'm getting this error…
我收到此错误...
Fatal error: Call to undefined function mysql_connect() in C:\inetpub...\adodb\drivers\adodb-mysql.inc.php on line 363
致命错误:在 C:\inetpub...\adodb\drivers\adodb-mysql.inc.php 第 363 行调用未定义的函数 mysql_connect()
Update…
更新…
This link outlines the steps I followed to install PHP on my server:
How do I get PHP and MySQL working on IIS 7.0 ?
(note especially steps 6 and 8 regarting php.ini and php_mysql.dll).
此链接概述了我在服务器上安装 PHP 所遵循的步骤:
如何让 PHP 和 MySQL 在 IIS 7.0 上工作?
(特别注意关于 php.ini 和 php_mysql.dll 的步骤 6 和 8)。
Only two lines in the phpinfo report reference SQL:
phpinfo 报告中只有两行引用了 SQL:
<?php
phpinfo();
?>
Configure Command:
cscript /nologo configure.js "--enable-snapshot-build" "--enable-mysqlnd"sql.safe_mode:
Local Value Off, Master Value Off
配置命令:
cscript /nologo configure.js "--enable-snapshot-build" "--enable-mysqlnd"sql.safe_mode:
本地值关闭,主值关闭
PHP Configure Command http://img79.imageshack.us/img79/2373/configurecommandmw8.gif
PHP 配置命令 http://img79.imageshack.us/img79/2373/configurecommandmw8.gif
PHP sql.safe_mode http://img49.imageshack.us/img49/3066/sqlsafemoderu6.gif
PHP sql.safe_mode http://img49.imageshack.us/img49/3066/sqlsafemoderu6.gif
Update…
更新…
I found the solution: How do I install MySQL modules within PHP?
我找到了解决方案:如何在 PHP 中安装 MySQL 模块?
回答by ólafur Waage
Check out phpinfo to see if the mysql functions are compiled with your PHP
查看phpinfo,看看mysql函数是不是用你的PHP编译的
<?php
phpinfo();
?>
Since in some versions of php, its not default with the install.
因为在某些版本的 php 中,它不是默认的安装。
Edit for the Update:
编辑更新:
You should have a full MySQL category in your phpinfo();
你的 phpinfo() 中应该有一个完整的 MySQL 类别;
See this for example: https://secure18.easycgi.com/phpinfo.php(googled example)
例如,请参见:https://secure18.easycgi.com/phpinfo.php(谷歌搜索示例)
回答by Geoff
It sounds like the version of PHP you are using has not been compiled with MySQL support, or has not been enabled in the php.ini.
听起来您正在使用的 PHP 版本尚未通过 MySQL 支持进行编译,或者尚未在 php.ini 中启用。
回答by James Marshall
Looks like you haven't got the MySQL PHP extensions installed! You shouldn't have to do any configuration other than installing the correct modules (and shouldn't be doing anythingwith ADODB).
看起来您还没有安装 MySQL PHP 扩展!除了安装正确的模块之外,您不应该进行任何配置(并且不应该对 ADODB进行任何操作)。
PHP comes in 2 versions as well - a CGI version and an ISAPI module. You're best using the ISAPI version with ISS and adding all the trimmings...
PHP 也有 2 个版本 - CGI 版本和 ISAPI 模块。您最好将 ISAPI 版本与 ISS 一起使用并添加所有装饰品...
回答by Zack Peterson
I found the solution: How do I install MySQL modules within PHP?
我找到了解决方案:如何在 PHP 中安装 MySQL 模块?