Forum Moderators: coopster
When I try to send a newsletter I get
"Warning: fopen(test.htm): failed to open stream: Permission denied in /home/website/plugins/st_newsletter/shiftthis-pages.php on line 229
can't open file"
What do I need to do to fix this?
chmod something?
the guy who wrote the plugin is out of town for 15 days!
[edited by: dreamcatcher at 10:31 am (utc) on Nov. 13, 2006]
[edit reason] Generalized url. [/edit]
chmod u+x test.htm
--Nick
[man.he.net...]
If you didn't already have it (sounds like you did, but just wanted to make sure) :-)
On line 229 of shiftthis-pages.php its attempting to do something like:
fopen($somefile) and halting right there, if you have access to the file (shiftthis-pages.php) check the code and determine where $somefile is being set. If its hard-coded like fopen("/home/rasmus/file.txt", "r") then make sure the file is in that directory and you have authorization to access it within the app, ie. it might be a security issue if access is allowed which would explain why its being denied.
If it still doesn't work, check the plugin documentation and make sure the script you have doesn't interfere with what the plugin is trying to accomplish.
I'm sure others have a better way of debugging, but those are some of the preliminary steps I'd take............also, make sure things are spelled correctly :-)
--Nick
If all that fails, call the guy up and explain the situation.
"test.htm" is only asked for here:
<?php if ( isset($_GET['send_newsletter']) ) {
$nid = $_GET['send_newsletter'];
$from = $st_newsletter_config['newsletter_efrom'];
$title = $wpdb->get_var("SELECT st_title FROM $table_prefix"."st_newsletter WHERE st_id=$nid");
$subject = $st_newsletter_config['newsletter_esubject'].$title;
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '. $from . "\r\n";
$html = newsletter_returnhtml($nid, $email);
$filename = 'test.htm';
$ourFileHandle = fopen($filename, 'w') or die("can't open file");
fwrite($ourFileHandle, $html);
fclose($ourFileHandle);
I tried making "test.htm" and chmod to 777 in a few different directories, but to no avail!
Thanks for any suggestions