dongsimu4422 2008-12-12 01:21
浏览 56
已采纳

IIS,MySQL上的MySQL - 在提供页面时没有加载MySQL

I have, as best as I can manage, set up IIS (6.0), PHP (5.2.8) and MySQL (5.1.30) on Windows Server 2003, with all the involved mucking about (I think) in IIS and PHP to get things talking to each other.

PHP does work - however, I cannot use the mysql or mysqli libraries from a PHP page. Fatal error: Class 'mysqli' not found in...
Fatal error: Call to undefined function mysql_connect() in...

Information relating to MySQL or MySQLi does not appear when using phpinfo() in a PHP page.

However, when I invoke PHP from the command line, such as

> php -r phpinfo()

Information relating to MySQL and MySQLi does appear in the output from that.

Restarting IIS or the OS does not produce further effect. I have only one php.ini file, in the PHP root directory.

Do I need to connect MySQL to IIS somehow as well, or is there another problem?

  • 写回答

1条回答 默认 最新

  • doulaobi7988 2008-12-12 01:24
    关注

    The php.ini file used for command-line usage of PHP may be different from the php.ini used by the web server. You should get phpinfo() information by putting a small PHP script under your web server's document space:

    <?php
    phpinfo();
    ?>
    

    Open this PHP script by using your browser to request that PHP script via an URL to your web server. That will tell you what the web server thinks is your PHP configuration.

    Also remember that you need to restart the web server for edits to php.ini to take effect. It only reads the php.ini when the web server starts.

    There are numerous places the php.ini file that your IIS instance is using might live. See http://php.net/manual/en/configuration.php or http://www.iis-aid.com/articles/how_to_guides/where_php_ini_is_loaded_from for details.

    Look at the output of phpinfo() when viewed in your browser, and look for the item "Loaded Configuration File".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记