1

XAMPPをWindowsXPマシンにインストールしました。PHPスクリプトは、ブラウザを介して正常に機能しています。

当初、PHP.exe(CLI)はエラーで失敗していました-php_pgsql.dllをロードできません

php.iniファイルでextension=php_pgsql.dllを無効にしたところ、PHP.exeが失敗しました。

ただし、現在でも、同じスクリプトがブラウザーで正常に実行されていても、CLIからPHPスクリプトを実行することはできません。

スクリプトはmysqli_connect()でエラーで失敗します-「127.0.0.1」でMySQLサーバーに接続できません

他の誰かが同じ問題に直面しましたか?

Kshitij

4

3 に答える 3

1

Did you start the MySQL service via the XAMPP Control panel and it kept beeing marked as "Running" in both test cases?
Did you test the webserver version by requesting something like http://localhost/... or http://127.0.0.1/... and did you run the php.exe -f something.php test on the same machine?

于 2009-07-02T14:33:43.617 に答える
1

php.ini はいくつありますか? CLI バージョンには、Web バージョンとは異なる php.ini が含まれている可能性があります。

于 2009-07-02T13:47:41.743 に答える
0

コマンド セッションの PATH 環境変数に mysql DLL へのパスがありますか? おそらくパスに \pathtomysql\bin を追加する必要があります。私のマシンでは次のとおりです。

C:\Program Files\MySQL\MySQL Server 5.0\bin
于 2009-07-02T13:47:40.120 に答える