我尝试在我的服务器上执行一个简单的perl脚本,我得到一个内部500服务器,当我检查错误日志时,它显示:
Premature end of script headers: test.pl
这是perl脚本:
#!/usr/bin/perl -w
print "Content-type: text/plain\n\n";
print "testing...\n";
Run Code Online (Sandbox Code Playgroud)
我的cgi-bin文件夹具有0755的权限.脚本本身也是0755.该脚本由apache拥有,并且在apache组中.该脚本通过命令行正常工作.
有什么问题,我该如何解决这个问题?!
谢谢大家的帮忙!
有趣的发现在suExec:
2010-09-14 17:38:28]: uid: (10001/som) gid: (2522/2522) cmd: test.pl
[2010-09-14 17:38:28]: target uid/gid (10001/2522 or 2521) mismatch with directory (48/0) or program (48/0)
Run Code Online (Sandbox Code Playgroud)
但我的cgi文件夹与test.pl脚本相同 - 它是指另一个目录吗?
我想把填充放在css边框上.将它拉入div内,远离边缘.这可能是使用css(css3很好,webkit).
这是设计.

我通过在div中放置一个div来做到这一点,然后给内部div一个边框.我想让标记变得苗条,所以我想只使用一个div,如果可行的话.
谢谢.
这不是一个真正的编程问题,是否有命令行或Windows工具(Windows 7)来获取文本文件的当前编码?当然我可以写一个小C#应用程序,但我想知道是否有内置的东西?
我意识到过早优化具有主观成分,但这是一个经验或最佳实践问题.
在为iOS编程时,我是否更喜欢使用struct和typedef,其中对象没有"行为"(方法,基本上)?我的感觉是struct对于非C人来说语法有点奇怪,但它应该是低调的.然后,用50K NSObject实例测试一些案例,它似乎并不坏(相对,我知道).NSObject除非我遇到性能问题,否则我应该"习惯它"(尽可能使用结构)或实例正常吗?
典型的情况是具有两个int成员变量的类.我已经读过使用结构来保存两个NSString实例(或任何子NSObject类)是一个坏主意.
我目前只有一个解决方案,包含目前为止开发的一个应用程序和所有本地库的项目.整个解决方案也保存在一个Git仓库中.我现在要开发第二个将使用相同库的应用程序.该应用程序将具有与第一个和不同版本不同的发布周期.我的问题是如何分解代码,无论是在解决方案设置方面还是在Git方面.
在谈论答案之前,还有一些其他有用的细节:
我一直在脑子里想着几个想法,但似乎没有一个想法令人满意.我考虑过只保留一个解决方案/一个Git仓库.我还考虑过使用子模块将解决方案分成几个Git repos,但子模块很麻烦.我还想过让每个应用程序都有自己的解决方案和所有库.那么问题是我是否可以在visual studio中打开多个解决方案.库经常需要随应用程序一起更改,因此在单独的解决方案或Git repos中将它们分开太多会使库和应用程序保持同步变得困难.我所关心的另一个问题是分支.如果我将解决方案拆分为几个Git存储库,我可以为每个应用程序分支,但如果我保留一个Git存储库,
我甚至可能不会向自己提出正确的问题,也有可能我只是有一个心理障碍阻止我解决一个简单的解决方案.无论哪种方式,我都会向SO社区提出一些想法.我希望一切都清楚,但如果没有,我会很高兴澄清.
c# git project-management projects-and-solutions visual-studio
Maven将axis-1.3.jar和axis-1.4.jar放到我战争的WEB-INF/lib中.有人可以解释如何告诉它只使用axis-1.4.jar吗?
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>dummy</groupId>
<artifactId>test-war</artifactId>
<version>0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>dummy</groupId>
<artifactId>war-part2</artifactId>
<name>war-part1</name>
<version>0.1</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.jaspersoft.jasperserver</groupId>
<artifactId>jasperserver-ireport-plugin</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)
[dependency:tree {execution:default-cli}]
+- org.apache.axis:axis:jar:1.4:compile
\- com.jaspersoft.jasperserver:jasperserver-ireport-plugin:jar:2.0.1:compile
+- javax.activation:activation:jar:1.1:compile
+- javax.mail:mail:jar:1.4:compile
+- log4j:log4j:jar:1.2.12:compile
\- com.jaspersoft.jasperserver:jasperserver-common-ws:jar:2.0.1:compile
+- xerces:xercesImpl:jar:2.8.1:compile
| \- xml-apis:xml-apis:jar:1.3.03:compile
\- axis:axis:jar:1.3:compile
+- axis:axis-jaxrpc:jar:1.3:compile
+- axis:axis-saaj:jar:1.3:compile
+- wsdl4j:wsdl4j:jar:1.5.1:compile
+- commons-logging:commons-logging:jar:1.0.4:compile
\- commons-discovery:commons-discovery:jar:0.2:compile
Run Code Online (Sandbox Code Playgroud)
Maven是2.2.1
我有几个服务:
用@Service注释注释.如何排除除一个以外的所有服务?
例如,我想只使用MailService.我使用以下配置:
<context:component-scan base-package="example">
<context:include-filter type="aspectj" expression="example..MailService*" />
<context:exclude-filter type="aspectj" expression="example..*Service*" />
</context:component-scan>
Run Code Online (Sandbox Code Playgroud)
但现在所有服务都被排除在外.
如果存在一个包含MailService的规则,为什么要排除所有服务?
我正在编写一个PHP脚本,它接受来自用户的正则表达式模式,由preg_match()使用.如何检查模式是否有效?
我有一个函数返回两个值,如下所示:
[a b] = myfunc(x)
Run Code Online (Sandbox Code Playgroud)
有没有办法在不使用临时变量的情况下获得第二个返回值,而无需更改函数?
我正在寻找的是这样的:
abs(secondreturnvalue(myfunc(x)))
Run Code Online (Sandbox Code Playgroud) 我试图利用PHP中的自动加载.我在不同的目录中有各种类,所以我已经引导自动加载如下:
function autoload_services($class_name)
{
$file = 'services/' . $class_name. '.php';
if (file_exists($file))
{
require_once($file);
}
}
function autoload_vos($class_name)
{
$file = 'vos/' . $class_name. '.php';
if (file_exists($file))
{
require_once($file);
}
}
function autoload_printers($class_name)
{
$file = 'printers' . $class_name. '.php';
if (file_exists($file))
{
require_once($file);
}
}
spl_autoload_register('autoload_services');
spl_autoload_register('autoload_vos');
spl_autoload_register('autoload_printers');
Run Code Online (Sandbox Code Playgroud)
这一切似乎都很好,但我只想仔细检查这确实被认为是可以接受的做法.