在导入了淘宝开放平台的SDK文件包后,尝试调用其中一些简单的接口,虽然相应的信息都能正确调出,但会有很多提示信息,大致都是说的没有权限添加文件之类的,不知道是SAE的问题还是淘宝的问题还是什么,烦请指教。下面是前5个Warning(总共几十个,所以就不全部列出了。):Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/usr/local/sae/php/lib/php/sae_std_lib:/usr/local/sae/php/lib/php/apibus_lib:.:/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/:/saetmp/928/域名/1420332944_2799402612/:) in taobao_sdk/lotusphp_runtime/Lotus.php on line 55User notice: invalid [default store dir]: /tmp/ in taobao_sdk/lotusphp_runtime/Lotus.php on line 61Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/LtStoreFile/LtAutoloader-token-cache/b7/cc) is not within the allowed path(s): (/usr/local/sae/php/lib/php/sae_std_lib:/usr/local/sae/php/lib/php/apibus_lib:.:/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/:/saetmp/928/域名/1420332944_2799402612/:) in taobao_sdk/lotusphp_runtime/StoreFile.php on line 33User notice: Can not create /tmp/LtStoreFile/LtAutoloader-token-cache/b7/cc in taobao_sdk/lotusphp_runtime/StoreFile.php on line 37Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/tmp/LtStoreFile/LtAutoloader-token-cache/b7/cc/b7cc5645e3951db1668cffd1f4c0755d.php) is not within the allowed path(s): (/usr/local/sae/php/lib/php/sae_std_lib:/usr/local/sae/php/lib/php/apibus_lib:.:/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/:/saetmp/928/域名/1420332944_2799402612/:) in taobao_sdk/lotusphp_runtime/StoreFile.php on line 40Warning: file_put_contents() [function.file-put-contents]: open_basedir restriction in effect. File(/tmp/LtStoreFile/LtAutoloader-token-cache/b7/cc/b7cc5645e3951db1668cffd1f4c0755d.php) is not within the allowed path(s): (/usr/local/sae/php/lib/php/sae_std_lib:/usr/local/sae/php/lib/php/apibus_lib:.:/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/:/saetmp/928/域名/1420332944_2799402612/:) in taobao_sdk/lotusphp_runtime/StoreFile.php on line 48Warning: file_put_contents(/tmp/LtStoreFile/LtAutoloader-token-cache/b7/cc/b7cc5645e3951db1668cffd1f4c0755d.php) [function.file-put-contents]: failed to open stream: Operation not permitted in taobao_sdk/lotusphp_runtime/StoreFile.php on line 48所有的Warning似乎都和tmp、usr这两个目录有关,比如第一个Warning似乎说的是tmp目录不存在,但我不清楚是需要我自己添加这个目录吗?我尝试添加到淘宝SDK的根目录下过,但没有用。最多只能给100分
你访问的文件越出了 open_basedir 设定的范围如果你无法修改 open_basedir 的值,那么就请将包放在 open_basedir 允许的目录中
/usr/local/sae/php/lib/php/sae_std_lib:/usr/local/sae/php/lib/php/apibus_lib:.:/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/:/saetmp/928/域名/1420332944_2799402612/:因为用的是SAE的云服务器,我的代购都存在/域名/1/这个根目录下,我把淘宝的那个SDK包也放在这个根目录 下还是不行,仍然提示tmp这个目录没有访问权限
/usr/local/sae/php/lib/php/apibus_lib
.
/usr/share/fonts/chinese/TrueType:/usr/local/sae/php/lib/php/pear:/data1/www/htdocs/928/域名/1/
/saetmp/928/域名/1420332944_2799402612/都是有效的目录
不过除了 . 以外都是 SVN 产生的所以你只需在你本地调试好(当然 SDK 包在你的网站目录中)SVN 上去就不会有问题了
你应该在你本地服务器中建一个以域名命名的目录,其中有一个 1 目录(表示版本号)用于放置你的网站
第一次 svn 提交后,还会产生一个 .svn 的目录。这都不需管他
你只要在你的 1 目录中调试好你的网站就可以了
提交在 域名目录 或 1目录上进行都可以如果你是在弄不清楚那些目录的关系,那么可以下载一个 SAE 的本地运行环境(这样就不必再自己配置环境了)。这个环境完全模拟了 SAE 服务器环境,只要在这个环境中调试的网站,传上去就不会有问题