简体   繁体   English

如何在 htaccess 中启用 MySQLi 扩展

[英]How to enable MySQLi extension in htaccess

How to enable MySQLi extension for PHP in htaccess?如何在 htaccess 中为 PHP 启用 MySQLi 扩展? Is it even possible to enable PHP extensions through htaccess file?甚至可以通过 htaccess 文件启用 PHP 扩展吗?

You don't.你没有。

Mysqli should be installed as a PHP-module and loaded through php.ini . Mysqli 应作为 PHP 模块安装并通过php.ini加载。

Assuming you use a debian-related Linux distribution, this can be done by issuing apt-get install php5-mysqli .假设您使用与 debian 相关的 Linux 发行版,这可以通过发出apt-get install php5-mysqli来完成。

If this is not an option, please read the PHP documentation on this module and follow the steps described there.如果这不是一个选项,请阅读此模块上的 PHP 文档并按照其中描述的步骤进行操作。

The extension= directive is only valid in the central php.ini , it cannot be set from within .htaccess files. extension= 指令仅在中央php.ini中有效,不能从 .htaccess 文件中设置。

At best you could load it manually in your PHP script:充其量您可以在 PHP 脚本中手动加载它:

<?php
   dl("mysqli.so");

Only works until PHP 5.2仅在 PHP 5.2 之前有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM