对于我的“未找到"PDO类",这里没有解决方案. [英] No solution here works for my "Class 'PDO' not found."

查看:106
本文介绍了对于我的“未找到"PDO类",这里没有解决方案.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这里有一些标题相似的问题,但似乎没有一个适合我,因此是提出新问题的原因.

I know there are questions with similar titles here but none seem to work for me hence the reason to create a new question.

所以这是问题所在,我有一个可以在localhost上正常运行的站点,我确信该站点具有PDO支持,但是在共享主机上上传后,我得到了

So here's the problem, i have a site that works perfectly on localhost where i am sure has PDO support but after uploading on my shared hosting i get the

Symfony \组件\调试\异常\ FatalErrorException(E_UNKNOWN) 找不到"PDO"类

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) Class 'PDO' not found

这里的解决方案都涉及编辑php.ini和安装PDO,但是,我在共享主机上,无法访问php.ini文件或ssh.

the solutions here all involve editing php.ini and installing PDO however, i am on a shared hosting without access to php.ini file or ssh.

我正在使用带有航行器后端的laravel 5.5,php版本7.2.

I am using laravel 5.5, php version 7.2 with a voyager backend.

这是我的.htaccess的样子

here's what my .htaccess looks like

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

<IfModule mime_module>
  AddType application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>

任何帮助将不胜感激.谢谢.

Any help will be appreciated. Thanks.

推荐答案

联系您的托管支持,让他们为您启用PDO.

Contact your Hosting support and let them enable PDO for you.

在某些托管中,您可以通过在托管根目录中创建php.ini文件来覆盖php.ini.如果您在Windows托管中,则需要在php.ini中启用这些扩展.

In some hosting you can overwrite php.ini by creating php.ini file in your hosting root. These are the extensions you need to enable in php.ini if you are in windows hosting.

extension=php_pdo.dll
extension=php_pdo_mysql.dll

检查您的托管服务提供商是否已安装PDO. 创建index.php文件或您可以访问的任何其他文件.内容必须具有

Check if PDO is already installed by your hosting provider. Create index.php file or any other file which you can access. The content must have

<?php
    phpinfo();
?>

如果已经安装了PDO,则下一步是运行composer install(需要SSH访问).您必须事先删除供应商文件夹.假设您的公用文件夹是/var/www/html.转到html目录并运行

If PDO is installed already, the next thing to do is running composer install (SSH access required). You must delete your vendor folder beforehand. Assuming that your public folder is /var/www/html. go to the html directory and run

composer install

这篇关于对于我的“未找到"PDO类",这里没有解决方案.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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