是否“使用lib”? 适用于 UNC 路径?
我的托管脚本已被移动并且不再起作用。
指定的CGI应用程序 行为不端,没有返回完整的 HTTP 标头集。
我注意到我的托管公司的某人修改了我的脚本,因此我以前使用的脚本
use lib 'd:/myorig/LIB';
现在
use lib '//newhost/LIB';
可以使用吗?
我尝试了 1800 INFORMATION 的建议并运行了...的最小脚本,
#!perl -w
use lib '//whatever/lib';
print "success";
得到了相同的结果。
更新:ysth对FatalsToBrowser的建议确实揭示了更多信息。 看起来路径(由托管公司的某人添加)可能是错误的。
更新2:托管公司现在表示,这些脚本与以前的托管思想没有变化,但会引发大量语法错误。 “由于我们无法为您调试您的脚本,我们建议您联系原始程序员并向他们寻求帮助”。 <磨牙>
部分解决:托管公司终于意识到他们没有正确设置权限。 他们仍然不对,而且(啊)他们不允许网站所有者设置文件夹权限,甚至不允许在他们自己网站内的文件夹上设置权限。
My hosted scripts have been moved and no longer work.
The specified CGI application
misbehaved by not returning a complete
set of HTTP headers.
I notice that someone at my host company has modified my scripts so that where I used to have
use lib 'd:/myorig/LIB';
I now have
use lib '//newhost/LIB';
Should this work?
I tried 1800 INFORMATION's suggestion and ran the minimal script of
#!perl -w
use lib '//whatever/lib';
print "success";
...which gave the same result.
Update: ysth's suggestion of FatalsToBrowser did indeed reveal more information. It looks like the path (added by someone from the hosting company) might be wrong.
Update2: The hosting company now says that these scripts, unchanged from the previous host mind, are throwing lots of syntax errors. "Since we cannot debug your scripts for you we suggest you contact the original programmer and ask them for help". <grinds teeth>
Partial Resolution: The hosting company finally realised they hadn't set permissions correctly. They still aren't right, and (aargh) they don't allow site owners to set folder permissionsn, not even on folders within their own sites.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不知道它是否应该起作用,但我的直觉是它会没问题。 但是,您发布的两行
use lib
行并不等效。也许您需要指定服务器上共享的路径? 另外,您可能需要查看权限? 也许运行 CGI 的用户无法访问该网络路径?
另外,您可以编写一个简单的(非 CGI)程序来测试您的理论并运行它:
然后如果可以的话,在服务器上运行它并看看会发生什么。
I don't know if it should work or not, but my intuition is that it would be okay. However, the two
use lib
lines you posted are not equivalent.Perhaps you need to specify the path to the share on the server? Also, you might need to look at permissions? Maybe the user the CGI is running as cannot access that network path?
Also, you could write a simple (non CGI) program to test your theory and just run it:
Then just run that on the server if you can and see what happens.
否,路径不完整,它需要服务器名称和完整路径。 这也是一种不好的做法,因为它需要监控两台机器而不是一台机器才能使应用程序正常运行。
No the path is incomplete it needs both a server name and a complete path. It is a bad practice as well because it requires that two machines be monitored rather than one for your application to function.
这是一个非错误。 如果幸运的话,您的托管公司将为您提供一个错误日志,其中将显示 perl 正在死亡的实际错误。 如果不,
考虑用于
测试。 (如果您很偏执(这并不是一件坏事),那么一旦完成测试,您将避免启用该功能,因为错误通常可以提供有关您的代码甚至数据库的信息,这可能有助于黑帽利用安全性洞。)
That's a non-error. If you are lucky, your hosting company will make an error log available to you that will show the actual error that perl is dying with. If not,
consider using
for testing. (If you are paranoid (which is not a bad thing to be), you will refrain from leaving that enabled once you are done testing, since errors can commonly provide information about your code or even your database that may help a black hat exploit security holes.)
我知道我在尝试使用 apache 的映射驱动器和 unc 路径时遇到了麻烦,因为不允许 apache 用户使用网络驱动器。 这很难弄清楚——但有可能做到。 这可能是一个相关的问题。
I know I ran into trouble trying to use mapped drives and unc paths from apache because the apache user was not allowed to use network drives. That was difficult to figure out -- but it's possible to do it. That may be a related problem.