如何在我的托管提供商中启用 pdo 扩展
1)我的整个应用程序是使用 sqlite 基于 PDO 构建的
我的问题: 托管提供商已禁用 PDO
- 我想知道如何让 PDO 扩展在我的托管提供商上工作。托管提供商似乎没有回应我的询问。那么有什么方法可以远程完成此操作吗?
1) My whole application is built on PDO with sqlite
My Problem:
The hosting provider has PDO --disabled
- I want to know how I can get PDO extensions to work on my hosting provider. The hosting provider just doesn't seem to respond to my queries. So is there any way i can do this remotely.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于您的托管提供商支持哪些功能以及您切换的意愿。
理想情况下,您需要切换,因为任何不提供 PDO 的网络主机也可能在其他地方犯下严重的错误。 (PDO 是在 PHP 中使用参数化 SQL 来防止 SQL 注入攻击的推荐方法)
如果您不想切换,最简单的解决方案可能是遵循 PEAR 的指南 设置本地 PEAR 安装,然后运行
pear install pdo
。如果您的主机允许自定义 HTTP 守护进程 (Apache) 设置,那么技术上更正确但更复杂的解决方案是在启用 PDO 的情况下在您的 homedir 中构建您自己的 mod_php 并使用它。 (据我所知,使用 PHP 中包含的 PDO 是捆绑它的版本的推荐解决方案)
如果您无法设置自定义 Apache 实例,您可以尝试的另一个选择是构建自定义 PHP,然后使用 .htaccess 通过 FastCGI 运行它。
除此之外我想不出任何选择。
It depends on what functionality your hosting provider supports and how willing you are to switch.
Ideally, you'll want to switch since any webhost that doesn't offer PDO is also probably making nasty mistakes elsewhere too. (PDO is the recommended way to use parameterized SQL with PHP to prevent SQL injection attacks)
If you don't want to switch, the simplest solution is probably to follow PEAR's guide to setting up a local PEAR install and then to run
pear install pdo
.A more technically correct but more involved solution, if your host allows custom HTTP daemon (Apache) setups is to build your own mod_php in your homedir with PDO enabled and use that. (Using the PDO included with PHP is, as far as I know, the recommended solution for versions that bundle it)
Another option you could try if you can't set up a custom Apache instance is to build a custom PHP but then use .htaccess to run it via FastCGI.
I can't think of any options other than that.
如果这是共享主机,那么您的网络主机必须允许此类功能。联系他们并解释您的需求。如果他们找不到与他们见面的方式,或者您的疑问仍然得不到答复,请更换主持人。它们的数量不计其数。
If this is shared hosting, then your web host must allow such functionality. Contact them and explain your needs. If they can't find a way to meet them or your queries continue to go unanswered, switch hosts. There's a gazillion of them.