ThaiSEOBoard.com

Host and Domain => Host & Domain (general) => ข้อความที่เริ่มโดย: pickme ที่ 28 ธันวาคม 2008, 15:39:07



หัวข้อ: มีปัญหาการใช้ PHP ใครเคยใช้โฮส Pair.com ช่วยด้วยครับ
เริ่มหัวข้อโดย: pickme ที่ 28 ธันวาคม 2008, 15:39:07
รบกวนสอบถามคนที่เคยใช้โฮส Pair.com หรือคนที่รู้วิธีแก้ไขด้วยครับ คือว่า ผมจะทำเว็บเกี่ยบกับจองโรงแรม (ของ r24) กะว่าจะใช้ code php ที่เค้าให้มา (ด้านล่างนี้) เพื่อแสดงรายชื่อโรงแรมที่หน้าเว็บของผม

โค๊ด:
<?php
$partner 
"abc.com"# replace PARTNER by your R24-registered domain name.
$cur $_REQUEST[&#39;cur&#39;]; if (!$cur) $cur = "USD"; # optional. if you want a DEFAULT currency other than THB
$rset $_REQUEST[&#39;rset&#39;]; if (!$rset) $rset = "bangkok"; # replace "bangkok" by whatever region you want to call initially
# don&#39;t change remaining code below this line
$thispage "V4&rf4=".$_SERVER[&#39;HTTP_HOST&#39;].$_SERVER[&#39;PHP_SELF&#39;]."&ip=".$_SERVER[&#39;REMOTE_ADDR&#39;]."&rset=".$rset;
$thelink "http://www.R24.org/".$partner."/".$rset."/CALLER/CUR=".$cur."|SORT=".$_REQUEST[&#39;sort&#39;]."|FRAME=_blank|CALL=".$thispage; 
echo file_get_contents ($thelink);
?>

แต่ปรากฎว่า พอใส่ code ด้านบนนี้ ไว้ในหน้าเว็บเพจ เอาไฟล์ขึ้นโฮสของ pair.com เรียบร้อยแล้ว ... รองเปิดหน้าเว็บ www.abc.com/bangkok/index.php มันขึ้นข้อความว่า

โค๊ด:
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /usr/www/users/intharar/abc/bangkok/index.php on line 23

Warning: file_get_contents(http://www.R24.org/abc.com/bangkok/CALLER/CUR=USD|SORT=|FRAME=_blank|CALL=V4&rf4=www.abc.com/bangkok/index.php&ip=119.31.76.30&rset=bangkok) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /usr/www/users/intharar/abc/bangkok/index.php on line 23

ผมพึ่งสมัครใช้โฮส Pair.com (plan : Advance) อ่ะครับ ... ไม่รู้ว่าต้องเซตค่าอะไรในระบบด้วยรึป่าว?? ใครที่เคยใช้โฮสของที่นี่ หรือคนที่รู้วิธีแก้ไข ช่วยแนะนำด้วยนะครับ ขอแบบละเอียดๆเลยยิ่งดี

ขอบคุณมากครับ


หัวข้อ: Re: มีปัญหาการใช้ PHP ใครเคยใช้โฮส Pair.com ช่วยด้วยครับ
เริ่มหัวข้อโดย: pickme ที่ 29 ธันวาคม 2008, 07:52:58
ถามไปที่ฝ่าย support ของ pair.com แล้ว ... เค้าตอบกลับมาแบบนี้อ่ะครับ


This is because "fopen", a function within PHP, is disabled for security
reasons on our server. You can either choose to run PHP as a CGI and edit
your own php.ini file, or you can edit a .htaccess file to include the
following line:

php_flag allow_url_fopen on

Please let us know if we can be of further assistance.


สรุปว่าผมต้องทำยังงัยบ้างอ่ะครับ ภาษาอังกฤษไม่แข็งแรง php ก็ไม่รู้เรื่องเลย
รบกวนช่วยอธิบาย แล้วก็บอกวิธีแก้ไขมาเป็นขั้นตอนแบบละเอียดๆด้วยนะครับ

ขอบคุณมากๆครับ


หัวข้อ: Re: มีปัญหาการใช้ PHP ใครเคยใช้โฮส Pair.com ช่วยด้วยครับ
เริ่มหัวข้อโดย: tung101 ที่ 29 ธันวาคม 2008, 11:32:10
สร้างไฟล์ .htaccess ครับแล้วใส่คำสั่งนี้ลงไป

php_flag allow_url_fopen on

ก็สามารถใช้งานได้แล้วครับลองดู