在namecheap

时间:2017-11-23 13:18:54

标签: php html sh

所以我有一个带有shell_exec命令的index.php文件,当我在ubuntu的终端上运行它时它工作正常,但是当上传到namecheap主机时它不起作用。

http://www.logh.info/这是网站,是的我100%确定.sh文件的路径是正确的

<html>
<head>
<style>
div {
font family: Ubuntu;
background-color: #F2F2F2;
}
</style>
</head>
<body>
<div>
<h1> <center> Instagram Full Size Profile Picture </center> </h1>
</div>
<center>
<?php 
if(isset($_REQUEST['input'])) {
$name = $_REQUEST['input'];
$output = shell_exec("/home/loghgxli/public_html/instapic.sh $name");
?>
<form action="" method="get">
Enter Instagram Username: <input type="text" name="input">
<input type="submit" value="View">
</form>
<?php
if(isset($output)) {
echo "<img src=$output>";
}
?>
</center>
</body>

#!/bin/bash
NAME=$1
#curl -s https://instagram.com/$NAME/ | grep image | grep fbma | sed 's,s150x150/,,g' | cut -f 4 -d '"'
curl -s https://instagram.com/$NAME/ | grep "og:image" | sed 's,s150x150/,,g' | cut -f 4 -d '"'

2 个答案:

答案 0 :(得分:0)

您可以检查他们(您的托管服务提供商)是否允许您shall_exec()

执行ini_get('disable_functions')

答案 1 :(得分:0)

您应该以这种方式将参数传递给您的脚本:

delete from myTable

(更多信息:Passing Variables to shell_exec()?