I don't think there is anything wrong with function drupal_eval(). It just tries to run some php code which you have written in a post or in a block and fails. The error is in line 22 of your own code, apparently a call to file_get_contents(http://abc.mywebsite.com/?prt=test).
What is your PHP version?
One thing you could try is to add allow_url_fopen = true and allow_url_include = true in php.ini, but I smell a security risk in allowing remote includes.
On Sat, Jul 12, 2008 at 10:53 PM, tom lee freemail168@gmail.com wrote:
Hello,
I got the following error in my application.
warning: file_get_contents(http://abc.mywebsite.com/?prt=test) [function.file-get-contents]: failed to open stream: Connection refused in /var/www/html/includes/common.inc(1352) : eval()'d code on line 22.
here is content in common.inc near the line 1352:
function drupal_eval($code) { ob_start(); print eval('?>'. $code); //line 1352 here $output = ob_get_contents(); ob_end_clean(); return $output; }
from my web server linux box, wget http://abc.mywebsite.com/?prt=test doesn't work before, connection refused. I later get it works. However, I still keep getting the same error.
I tried to replace the line print eval('?>'. $code); with teh following code. /* print eval('?>'. $code); */ $code = str_replace('<'.'?php','<'.'?',$code); eval('?'.'>'.trim($code).'<'.'?');
and then restart apache web server, and even tried to reboot computer. still the same error message generated, though the line 1352 is a comment line now.
I wonder if there is cache or precomiled code in drupal causing this problem?
Thanks.
[ Drupal support list | http://lists.drupal.org/ ]