运行环境ubuntu10.04,php+mysql+apache,
问题简述:shell调用nikto并生成一个txt文件,php调用shell,ubuntu调用php,
txt文件没有生成,为什么?我在 php 页面中调用shell脚本:
php:
<?
echo "test";
system("/home/test/下载/nikto-2.1.3/hello.sh ");
?>
shell 脚本
#!/bin/bash
#hello world
#a function
function hello()
{
echo "url:www.fjnu.edu.cn"
perl nikto.pl -h "www.fjnu.edu.cn" -o test.txt
}
echo "begin"
hello
echo "end"浏览器访问php页面,页面显示
begin url:www.fjnu.edu.cn end 但没有生成 test.txt页面,哪里出问题了?
谢谢~
问题简述:shell调用nikto并生成一个txt文件,php调用shell,ubuntu调用php,
txt文件没有生成,为什么?我在 php 页面中调用shell脚本:
php:
<?
echo "test";
system("/home/test/下载/nikto-2.1.3/hello.sh ");
?>
shell 脚本
#!/bin/bash
#hello world
#a function
function hello()
{
echo "url:www.fjnu.edu.cn"
perl nikto.pl -h "www.fjnu.edu.cn" -o test.txt
}
echo "begin"
hello
echo "end"浏览器访问php页面,页面显示
begin url:www.fjnu.edu.cn end 但没有生成 test.txt页面,哪里出问题了?
谢谢~
你确定这句是生成文件的?
#hello world
#a function
function hello()
{
curl --head www.fjnu.edu.cn -o text.txt
}
hello这样即可,当然你要装了curl
谢谢你的回答,
但我希望nikto生成test.txt页面,而不是curl。