我想通过PHP执行perl脚本.我exec()用来执行perl脚本.它在我的机器上工作,但在服务器上不起作用.服务器基于CentOS Linux.
我给了PHP和perl脚本文件完全许可(777).当我尝试执行时,我在error_log中收到以下错误
sh: /perl: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下方式执行
exec("perl -w Script.pl $username $password",$output);
exec("/usr/bin/perl -w Script.pl $username $password",$output);
exec("/usr/bin/perl Script.pl $username $password",$output);
Run Code Online (Sandbox Code Playgroud)
我也试过使用这个system功能
$output = system("perl Script.pl $username $password");
Run Code Online (Sandbox Code Playgroud)
我尝试这个时什么也没发生.
我还尝试使用该passthru()函数执行perl
passthru("/usr/bin/perl -w Script.pl $username $password",$output);
Run Code Online (Sandbox Code Playgroud)
当我执行此行时,$output打印127并且脚本中没有任何操作.
我用该is_executable()函数检查了文件是否可执行.它显示该文件不可执行.
代码如下
$file = 'Script.pl';
if (is_executable($file))
{
echo $file.' is executable';
}
else
{
echo $file.' is not executable';
}
Run Code Online (Sandbox Code Playgroud)
如果我通过终端执行perl,它工作正常但是当我尝试通过PHP执行时,它不起作用.
我想在通过Javascript在PHP上传图像之前验证图像分辨率.在我的PHP表单中,我想上传两个不同的图像,两个图像都有不同的分辨率限制.
我尝试以下代码
PHP代码
echo "<form name='add' enctype='multipart/form-data' action='AppActions.php' method='post' onSubmit='return validate_create();'>";
echo "<div class='form_label'>Album Wrapper (Big Image) *</div>";
echo "<div class='form_input'><input type='file' name='bigimage' id='bigimage' />";
echo "<div class='form_label'>Album Wrapper (Small Image) *</div>";
echo "<div class='form_input'><input type='file' name='smallimage' id='smallimage' />;
echo "<input type='submit' name='add' value='Create' class='Buttons' id='add'>";
Run Code Online (Sandbox Code Playgroud)
在Javascript中
function validate_create()
{
var bigimage = document.getElementById('bigimage');
var smallimage = document.getElementById('smallimage');
var big_img_width = bigimage.clientWidth;
var big_img_height = bigimage.clientHeight;
var small_img_width = smallimage.clientWidth;
var small_img_height = smallimage.clientHeight;
// if condtion to check the …Run Code Online (Sandbox Code Playgroud) 我想从两个表中获取数据,即使第二个表没有数据也是如此.我需要没有数据的空值.
例如,表1具有字段
表2有
某些时间表2没有特定用户的值.为此,我需要空值.
这里我给出样本输入和预期输出
table1
id name password
1 nam1 pass1
2 nam2 pass2
table 2
id f1 f2 f3
1 1 2 3
sample output
id name password f1 f2 f3
1 nam1 pass1 1 2 3
2 nam2 pass2 null null null
Run Code Online (Sandbox Code Playgroud)
我需要一个查询来获取数据.
php ×2
exec ×1
image-size ×1
javascript ×1
join ×1
mysql ×1
perl ×1
resolution ×1
shell ×1
validation ×1