Saving php Block Configure settings returns 404 page not Found

jeffreydalton.info - June 26, 2007 - 17:29

Hello,
I built a site up on one server and launched it on another server in a new hosting account. Everything launched fine and is working well with one strange exception. I have a custom php block that pulls a txt file and parses it for a random quote. This block is working fine on the server and has worked well on a couple other drupal sites I have created. On this new site though I cannot make changes to the block configure settings. I tried removing a url from the list of pages the block shows on and when I hit submit to save changes I get the 'page not found' response from drupal. On my dev site on another server I can save settings for this block.. just not on the production server.

I have run this php block code by itself as a stand alone php page and it runs fine... I have created and deleted blocks with php code and saved settings for other blocks with and without php code in them. It just seems when I use this specific code block I run into this issue. I even tried making a new block with this code and run into the same issue. Any help would be appreciated.

<?php
$file
= "quotes.txt";
$handle = fopen($file, "r");
if (!
$handle) {
print
"need quotes";
}else{
$quotes = fread($handle, filesize($file));
$results = explode("\n",$quotes);
fclose($handle);
$choose = (rand(1, sizeof($results)) - 1);
print
"<div id=\"quoteBox\"><div id=\"quoteKonji\"><div id=\"quoteText\">";
print_r($results[$choose]);
print
"</div></div></div>";
}
?>

mmm

tonyjo - June 26, 2007 - 20:41

Check the name you gave to the block,
and see if there are any modules that invoke the same name with block..... try this and come back if it didn't satisfy you.

Host server security setup was the issue

jeffreydalton.info - June 27, 2007 - 05:01

Just got feedback from the host and it turns out they have a security setting to block the functions I was calling for opening and parsing the txt file. This was not at all an issue with Drupal and was a security decision and setting with my host.

Thanks for the assistance though.

Similiar Error

DarkRestraint - October 3, 2008 - 07:00

I've been trying to set up a new block setup for a custom theme (Plutado for 6.X). Every time I try to save my blocks I get a 404, but if I change domain extensions (mysite.com to mysite.net or .org) the changes will be saved, but if I try to modify that I get the same error and have to switch extensions again.

I'm new to web design in general and after messing around with Drupal for a few months I'm still not entirely familiar with it. If you need any information just let me know and I'll be more than happy to provide it, I just need to figure this out.

Thanks.

DR

PS: Nevermind, I just realized this was for drupal 5 and I'm using 6. I'll post it in the appropriate spot.

 
 

Drupal is a registered trademark of Dries Buytaert.