douji8033
2018-11-13 08:51
浏览 182
已采纳

PHP pgsql不从命令行加载

I saw a similar question "Loads only from the command line". I have a different issue and on windows OS. I need to test some parts of code that has connections to other HTTPS sites, and I assume my browser caches some stuff that drops an error for the output. There for, I need to test my php script with a windows command line - which isnt hard to do. How ever, on pg_fetch_all it drops Call to undefined Function pg_fetch_all.

But I assume it connects to the database using pg_connect, otherwise it would drop an error before hand.

Is there something I am missing? Does pg_fetch_all has some values that I missed on reading about it? Or its simply because it is not loading a plugin, etc..

  • I am using PHP5.6
  • Loading it with simply: php file.php

My code for SQL as requested.

$station_keys = pg_fetch_all(
   pg_query(
      get_connection(), "SELECT val, val2, val3, val4 FROM table_keys"));

Everything works fine on browser (maybe apache's doing), the command line thinks it's weird.

My php -m prints out:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

pdsql is missing, it is enabled on wamp, it doesn't load when I am running command line.

图片转代码服务由CSDN问答提供 功能建议

我看到了类似的问题“仅从命令行加载”</ em>。 我有一个不同的问题,并在 Windows操作系统</ strong>。 我需要测试与其他HTTPS站点有连接的代码的某些部分,并且我假设我的浏览器缓存了一些丢失输出错误的东西。 在那里,我需要使用Windows命令行测试我的PHP脚本 - 这并不难。 但是,在 pg_fetch_all </ code>上它会删除调用未定义的函数pg_fetch_all </ code>。</ p>

但我认为它使用连接到数据库 pg_connect </ code>,否则会事先丢弃错误。</ p>

我有什么遗漏的吗? pg_fetch_all是否有一些我在阅读时错过的值? 或者仅仅是因为它没有加载插件等。</ p>

  • 我正在使用 PHP5.6 </ strong> </ em> </ li>
  • 只需加载: php file.php </ strong> </ em> </ li> </ ul>
    \ n

    我的SQL代码。</ p>

      $ station_keys = pg_fetch_all(
     pg_query(
     get_connection(),“SELECT val,val2,val3,  val4 FROM table_keys“)); 
     </ code> </ pre> 
     
     

    浏览器上的一切正常(可能是apache正在做的)</ em>,命令行认为这很奇怪。< / p>

    我的 php -m </ code>打印出来:</ p>

      [PHP Modules] 
    bcmath 
    bz2 
    calendar 
    Core  
    ctype 
    curl 
    date 
    dom 
    ereg 
    exif 
    fileinfo 
    filter 
    ftp \ NGD 
    gettext 
    gmp 
    hash 
    iconv 
    imap 
    intl 
    json \ NLDAP 
    libxml 
    mbstring 
    mcrypt 
    mhash 
    mysql 
    mysqli 
    mysqlnd  
    odbc 
    openssl 
    pcre 
    PDO 
    pdo_mysql 
    pdo_sqlite 
    Phar 
    Reflection 
    session 
    shmop 
    SimpleXML 
    soap 
    sockets \ NSPL 
    sqlite3 
    标准
    tokenizer 
    wddx 
    xml 
    xmlreader 
    xmlrpc 
    xmlwriter 
    xsl 
    zip 
    zlib  
     
     [Zend模块 s] 
     </ code> </ pre> 
     
     

    pdsql </ code>缺失,它在wamp上启用,当我运行命令行时它不会加载。</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题