doumou3883 2016-06-02 14:10
浏览 124

在Apache服务器中找不到Php PDO驱动程序

I have found a lot of instances of this problem but no matter what I try it still does not work.

I am running MAMP with Apache server on a windows 10. For the database management i am using PostgreSQL 9.5.

My error says:

Fatal error: Uncaught PDOException: could not find driver in C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Connection\PdoConnection.php:49 Stack trace: #0 C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Connection\PdoConnection.php(49): PDO->__construct('pgsql:host=loca...', 'postgres', 'prlbrd68', Array) #1 C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Adapter\Pdo\PdoAdapter.php(70): Propel\Runtime\Connection\PdoConnection->__construct('pgsql:host=loca...', 'postgres', 'prlbrd68', Array) #2 C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Connection\ConnectionFactory.php(41): Propel\Runtime\Adapter\Pdo\PdoAdapter->getConnection(Array) #3 C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Connection\ConnectionManagerSingle.php(76): Propel\Runtime\Connection\ConnectionFactory::create(Array, Object(Propel\Runtime\Adapter\Pdo\PgsqlAdapter)) #4 C:\MAMP\htdocs\Database assignment\vendor\propel\ in C:\MAMP\htdocs\Database assignment\vendor\propel\propel\src\Propel\Runtime\Connection\ConnectionFactory.php on line 43

From what I can understand the Apache server can not access the pdo_pgsql driver. I have modified the php.ini file inside Mamp/conf/php7.0.6 to include the extension=php_pdo_pgsql.dll as well as the php_pgsql.dll .

When I call the phpinfo() it tells me my set PDO is mysql but that is not the case. I have checked if the I am modifying the correctly loaded php.ini file. I have made sure that in my system PATH variable I have also added the location of the .dll's. I have tried to add another module to the server in the MAMP/conf/Apache/httpd.conf file by using the line " LoadFile "C:/Program Files/PostgreSQL/9.5/bin/libpq.dll" ". SOmeone sugeste that adding this line would force load the libraries, however when I added this line the server would not start at all. I have been stuck on this for a whole day. Any help is welcome!

  • 写回答

1条回答 默认 最新

  • duanjinchen5296 2016-06-02 14:24
    关注

    Try this in this order in php.ini

    extension=php_pgsql.dll 
    extension=php_pdo_pgsql.dll
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度