我正在尝试配置 ArrestDB 为我的站点创建一个 api。
https://github.com/alixaxel/ArrestDB
正如它在安装中所说,我需要将 $dsn 更改为: MySQL:
$dsn = 'mysql://[user[:pass]@]host[:port]/db/;
目前我有
$dsn = 'mysql://user:password@localhost/database/';
我用上面的括号试过了,但这会导致 503 服务不可用错误。当我删除括号时,会导致此错误:
{
"error": {
"code": 400,
"status": "Bad Request"
}
}
你知道我做错了什么吗?一切对我来说都是正确的
编辑:
尝试以下建议并返回 api:
array(28) {
["REDIRECT_STATUS"]=> string(3) "200"
["HTTP_HOST"]=> string(16) "api.shopsavr.com"
["HTTP_CONNECTION"]=> string(10) "keep-alive"
["HTTP_ACCEPT"]=> string(74) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
["HTTP_USER_AGENT"]=> string(109) "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"
["HTTP_ACCEPT_ENCODING"]=> string(17) "gzip,deflate,sdch"
["HTTP_ACCEPT_LANGUAGE"]=> string(14) "en-US,en;q=0.8"
["PATH"]=> string(209) "/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin"
["SERVER_SIGNATURE"]=> string(0) ""
["SERVER_SOFTWARE"]=> string(136) "Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.4.20"
["SERVER_NAME"]=> string(16) "api.shopsavr.com"
["SERVER_ADDR"]=> string(11) "50.28.7.250"
["SERVER_PORT"]=> string(2) "80"
["REMOTE_ADDR"]=> string(12) "67.247.5.220"
["DOCUMENT_ROOT"]=> string(30) "/home/shopsavr/public_html/api"
["SERVER_ADMIN"]=> string(26) "webmaster@api.shopsavr.com"
["SCRIPT_FILENAME"]=> string(40) "/home/shopsavr/public_html/api/index.php"
["REMOTE_PORT"]=> string(5) "58487"
["REDIRECT_URL"]=> string(8) "/PRODUCT"
["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1"
["SERVER_PROTOCOL"]=> string(8) "HTTP/1.1"
["REQUEST_METHOD"]=> string(3) "GET"
["QUERY_STRING"]=> string(0) ""
["REQUEST_URI"]=> string(8) "/PRODUCT"
["SCRIPT_NAME"]=> string(10) "/index.php"
["PHP_SELF"]=> string(10) "/index.php"
["REQUEST_TIME_FLOAT"]=> float(1383666718.92)
["REQUEST_TIME"]=> int(1383666718)
}