douhui5529 2017-10-26 23:20 采纳率: 100%
浏览 28
已采纳

我的php不解释postgresql或sql函数

hello to everyone here ... please i need your help . i have some trouble with php and my SGBDs ... i have installed php mysql and apache separately . but when i launch a php program with mysql_connect it send a 500 internal error without response . i have changed mysql to postgresql but it is the same problems . i have also remove the comma before some line in php.ini but it's the same result ... there is a simple connection to the database code examples `

<?php

$link = pg_connect('localhost', 'USERNAME', 'PASSWORD');
if (!$link) {`
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
pg_close($link);

` and there is the result the result of the code with 500 error and there is my php.ini file image of my php.ini thanks you

  • 写回答

2条回答 默认 最新

  • douang4294 2017-10-27 12:41
    关注
    • Have you restart apache ?

    • Set display_errors directive to On in your php.ini

    • Create info.php in your document root, put <? phpinfo(); ?> into it. Open info.php from your browser, try to find word "pdo_pgsql" / "pdo_mysql". Has it appear correctly ?

    • Dig into your apache access_log and error_log files to get further clue about your error.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置