php - PHP Symfony 服务器 - “驱动程序发生异常:找不到驱动程序”
问题描述
我使用终端命令symfony serve
(我也尝试过symfony server:start
)启动名为“test2”的 Symfony 应用程序,但出现错误:
处理异常时抛出异常(Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: could not find driver at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver .php 第 102 行)
我正在使用 Ubuntu 20.04、PHP 7.4、Symfony CLI 4.25,如果需要,还可以使用 Composer 2.0
我也在使用 PostgreSQL,我跑了sudo apt-get install php-pgsql
.
这是突出显示错误的整个响应:
[Web Server ] May 31 09:01:32 |DEBUG | PHP Using PHP version 7.4.18 (from default version in $PATH)
[Application] May 30 23:09:16 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: could not find driver at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 102)
[Application] May 30 23:09:16 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: could not find driver
[Application] May 30 23:16:58 |INFO | REQUES Matched route "index". method="GET" request_uri="https://localhost:8000/" route="index" route_parameters={"_controller":"App\\Controller\\TestController::index","_route":"index"}
[Application] May 30 23:16:58 |INFO | SECURI Populated the TokenStorage with an anonymous Token.
[Application] May 30 23:16:58 |CRITICA| REQUES Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred in driver: could not find driver" at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 102
[Application] May 30 23:16:58 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: could not find driver at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 102)
[Application] May 30 23:16:58 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: could not find driver
[Application] May 30 23:16:58 |CRITICA| REQUES Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred in driver: could not find driver" at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 102
[Application] May 30 23:16:58 |CRITICA| REQUES Exception thrown when handling an exception (Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: could not find driver at /var/www/html/test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php line 102)
[Application] May 30 23:16:58 |CRITICA| PHP Uncaught Exception: An exception occurred in driver: could not find driver
[Web Server ] May 31 09:01:32 |INFO | PHP listening path="/usr/sbin/php-fpm7.4" php="7.4.18" port=45197
[PHP-FPM ] May 31 09:01:32 |NOTICE | FPM fpm is running, pid 391
[PHP-FPM ] May 31 09:01:32 |NOTICE | FPM ready to handle connections
[PHP-FPM ] May 31 09:01:32 |NOTICE | FPM systemd monitor interval set to 10000ms
有人有想法吗?
在此先感谢任何帮助者:)
解决方案
您可能需要从该行中删除分号,然后重新启动您的网络服务器。
通常像sudo service httpd restart
.
推荐阅读
- python - 获取df python中单元格内的所有可能对
- c# - 是否可以比较列表 C# 中的字符串?
- php - 无法为 Symfony 项目安装 Mercure
- python - 有没有办法可以将数学函数设置为另一个函数的参数
- python - JSONS FIREBASE 真实数据库是 JSONS 吗?
- pagespeed - 带有预加载器/重定向的页面的 Pagespeed 洞察力评估
- spring-boot - 使用 Spring Security 5 OAuth2 Client Support 禁用 Spring Boot Actuator Basic Authentication
- azure - Azure Function ARM 模板删除不属于模板文件的现有应用程序设置
- python - 如何在python中使用隔离森林
- java - PostgreSQL Spring Boot - 未生成 hibernate_sequence