带有PHP 5.4的Apache 2.4:没有可用的MySQL [英] Apache 2.4 with PHP 5.4: no mysql available

查看:67
本文介绍了带有PHP 5.4的Apache 2.4:没有可用的MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows 7 x64计算机上使用PHP 5.4和MySQL 5.5设置了Apache 2.4 HTTP Server.

I've set up an Apache 2.4 HTTP Server with PHP 5.4 and MySQL 5.5 on my Windows 7 x64 machine.

一切正常,除了在PHP中仅加载"mysqlnd". mysql和mysqli丢失. php.ini中的条目可用且处于活动状态. PATH变量将附加到mysql二进制文件(libmysql.dll)的目录中.

Everything works fine, except that in PHP only the "mysqlnd" is loaded. mysql and mysqli are missing. The entries in the php.ini are available and active. The PATH variable is appended to the directory of the mysql binary files (libmysql.dll).

Apache 2.4的error.log中没有关于警告或错误的条目

There are no entries about warnings or errors in the error.log of Apache 2.4

有人有主意吗?

推荐答案

昨天,在Windows 7 64位计算机上设置了Apache 2.2和PHP 5.4.6之后,我也遇到了同样的麻烦.我在php.ini中进行了以下更改来解决此问题:

I had the same troubles yesterday, after settig up Apache 2.2 and PHP 5.4.6 on my Windows 7 64-bit machine. I resolved this with the following changes in the php.ini:

  1. 将extension_dir设置为(your-php-path)\ ext.

  1. Setting the extension_dir to (your-php-path)\ext.

extension_dir = "c:\progra~2\php546\ext"

当您使用文件夹名称的8.3版本时,可以避免文件夹名称程序文件(x86)中的空格.您可以使用以下命令获取它:

You can avoid the whitespaces in the foldername Program Files (x86) when you use the 8.3 version of the foldername. You can get it with the following command:

dir \prog* /x

  • 启用所需的MySQL模块.

  • Enable the wanted MySQL module(s).

    extension=php_mysql.dll
    extension=php_mysqli.dll
    ...
    extension=php_pdo_mysql.dll
    

  • 重新启动Apache Web服务器.

  • Restart Apache Web Server.

    for %s in (stop start) do net %s apache2.2
    

    您还可以使用Apache Monitor或服务重新启动它.

    You can also use the Apache Monitor or the Services to restart it.

    这篇关于带有PHP 5.4的Apache 2.4:没有可用的MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆