php 如何使用 Easy Apache 在 CPanel 中启用 PDO

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17758622/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:23:01  来源:igfitidea点击:

How do i enable PDO in CPanel using Easy Apache

phpcpanel

提问by hemanth kumar

I have connected to CPanel and tried to enable PDO for PHP in it.I have checked Many posts which says to find easyApache to enable PDO.But i am not able to find it in my CPanel Home.All i can find are the below functions

我已经连接到 CPanel 并尝试在其中为 PHP 启用 PDO。我检查了很多帖子,上面说找到easyApache 来启用 PDO。但是我在我的 CPanel Home 中找不到它。我只能找到以下功能

enter image description here

在此处输入图片说明

Please provide suggestions regarding this issue.Thanks in advance

请提供有关此问题的建议。提前致谢

采纳答案by ManojGeek

It is not possible from cPanel

无法从 cPanel

it is possible from WHM, You will find Easy Apache in WHM to configure PHP settings

可以从 WHM 中找到,您会在 WHM 中找到 Easy Apache 来配置 PHP 设置

If you are on shared hosting contact your hosting provider, they will enable it for u

如果您使用共享主机,请联系您的主机提供商,他们将为您启用它

回答by Ramnath

Goto PHP PEAR Package and Find a PHP Extensions and Applications Package

转到 PHP PEAR 包并查找 PHP 扩展和应用程序包

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

then install the PDO

然后安装 PDO

if you did not get this option you have to contact your hosting provider

如果您没有获得此选项,则必须联系您的托管服务提供商

回答by Akos Szelenyi

As mentioned by ManojGeek, PDOcan only be enabled in WHM(usually provided/installed by default by the hosting company if you use for example a VPS). If you used shared hosting, simply contact them to enable it.

正如 ManojGeek 所提到的,PDO只能在WHM(通常由托管公司默认提供/安装,如果您使用例如 a VPS)启用。如果您使用共享主机,只需联系他们以启用它。

However once you have access to WHM, follow these steps:

但是,一旦您可以访问WHM,请按照以下步骤操作:

Step One:In WHM search for "EasyApache (Apache Update)".

第一步:在 WHM 中搜索“EasyApache(Apache 更新)”。

Step Two:Leave Profile "Default" and scroll to the bottom and click "Build Profile".

第二步:将配置文件保留为“默认”并滚动到底部并单击“构建配置文件”。

Step Three:Select Apache version (best to leave on default) -> Click next.

第三步:选择Apache版本(最好保持默认)->点击下一步。

Step Four:Select a version PHP 5.X (5.5 recommended) -> Click next.

第四步:选择版本PHP 5.X(推荐5.5)->点击下一步。

Step Five:Scroll to the bottom and click "Exhaustive Options List".

第五步:滚动到底部并单击“详尽选项列表”。

Step Six:Find PDO and PDO_mySQL and tick checkboxes ->Click "Save and Build".

第六步:找到 PDO 和 PDO_mySQL 并勾选复选框 -> 点击“Save and Build”。

Important:Do NOTclose browser while config running. (takes about 2-5 minutes)

重要说明:待办事项同时配置运行关闭浏览器。(大约需要 2-5 分钟)

回答by Yuda Prawira

I am doing this way to enable PDO via cpanel you could use this step. it require suPHPenabled on your cpanel to follow this step.

我这样做是为了通过 cpanel 启用 PDO,您可以使用此步骤。它需要suPHP在您的 cpanel 上启用才能执行此步骤。

First, put this code in your .htaccess, edit with what you need.

首先,将此代码放在您的 .htaccess 中,使用您需要的内容进行编辑。

suPHP_ConfigPath /home/your_cpanel_user/public_html

Then create php.ini in your public_htmldirectory, then add following lines:

然后在您的public_html目录中创建 php.ini ,然后添加以下行:

extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_informix.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll  

This is works for me.

这对我有用。

回答by Shiv Singh

Follow these steps to enable PDO

按照以下步骤启用 PDO

Open WHM and go to Home? Software? Easy Apache(Apache Update)

打开 WHM 并转到主页软件Easy Apache(Apache 更新)

Scroll to the bottom and select "Start customizing based on profile"

滚动到底部并选择“根据个人资料开始自定义

Click "Next step" twice

单击“下一步”两次

Scroll to the bottom and select "Exhaustive Options List"

滚动到底部并选择“详尽选项列表

Select checkboxes for PDOand PDO MySQL, and rebuild Apache

选中PDOPDO MySQL 的复选框,并重建 Apache

This might be a good time to restart Apache using terminal (# service httpd restart). Hope that helps!

这可能是使用终端重新启动 Apache 的好时机(# service httpd restart)。希望有帮助!