私のコードはファイル()[function.file]:URLのファイルアクセスは、サーバー構成エラーで無効になっている
<?php
if ($_POST['hiddensms']) {
ini_set("allow_url_fopen", "ON");
ini_set("allow_url_include", "ON");
$smsno = explode(',', $_POST['hiddensms']);
foreach ($smsno as $mono) {
$baseurl = "http://api.xxxxxxxxxxxx.com";
$sql_q = "select firstname,lastname from tbl_newsletter where phone='" . $mono . "'";
$resultcount = mysql_query($sql_q);
$row_total_count = mysql_fetch_array($resultcount);
$first_name = $row_total_count['firstname'];
$last_name = $row_total_count['lastname'];
if ($_POST['sel_name_sms'] == 'FirstName') {
$setname = $first_name;
} else {
$setname = $last_name;
}
$smsBodyText = $_POST['sal_sms'] . ' ' . $setname . '\n';
$text = urlencode($smsBodyText . $_POST['msg_body']);
$to = $mono;
$url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
// do auth call
$ret = file($url);
// explode our response. return string is on first line of the data returned
$sess = explode(":", $ret[0]);
if ($sess[0] == "OK") {
$sess_id = trim($sess[1]); // remove any whitespace
$url = "$baseurl/http/sendmsg?user=xx&password=xxxxx&api_id=3370743&to=$to&text=$text";
//ht$ret = file($url);
$send = explode(":", $ret[0]);
if ($send[0] == "ID") {
echo "success\nmessage ID: " . $send[1];
} else {
echo "send message failed";
}
} else {
echo "Authentication failure: " . $ret[0];
}
}
}
?>
私はAPIによってSMSを送信しようとしていますが、私は、このエラー
を与えています警告:file()[function.file]:622行の/xxxxxxxsubscriber-list.phpのサーバー設定でURLファイルアクセスが無効にされている 警告:ファイル(http://api.xxxxx.com/http/) auth?user = xx & xx & api_id = xx)[function.file]:ストリームを開けませんでした:適切なラッパーが/xxxxxx/subscriber-list.phpの622行に見つかりませんでした 認証失敗:私は
<IfModule mod_php5.c>
php_admin_value allow_url_fopen On
php_admin_value allow_url_include On
</IfModule>
が、その動作していないように.htaccess設定
。私はphp.ini
allow_url_fopen = On
allow_url_include = On
に彼らが提案するいくつかのウェブ上で検索しましたが、私はphp.ini
にアクセスすることはできませんので、に他の方法任意のアイデアならば、私を助けてください
、何をすべきかを知りませんこれを痛めた?
多分代わりに私は 'php_admin_flag'を使用しますが、エラーを与える耕し' php_admin_value' http://www.php.net/manual/en/configuration.changes.php –
の 'php_admin_flag'を試してみてください –
php.iniのdisable_functionsにリストされているかもしれません – semsem