I'm trying to set a PHP to display an image from a Gallery. I know I could use an embedded gallery, but that isn't what I want to do :)
I get a 530 "Service Temporarily Unavailable" response. I don't get an error in my logs. I also don't get a watchdog message. The code runs fine if it put it in it's own php page.
I don't get an error if I take out the curl_exec, curl_close, and echo $file_content lines.
I'm hosted at Dreamhost.
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://example.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=none');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
Comments
Comment #1
tayknight commentedI did find an error in my error.log
[Mon Mar 13 21:58:05 2006] [error] [client xx.x.xxx.xx] mod_security: Access denied with code 503. Pattern match "(chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)\\(.*\\)\\;" at POST_PAYLOAD. [hostname "www.example.com"] [uri "/admin/block/configure/block/2"]
Comment #2
heine commentedThis is not a bug, but mod_security (an Apache module) interfering with your submission. It's trying to prevent harmful content from executing on your host's system. Contact you host to resolve this problem.