warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/fckstyles.xml) is not within the allowed path(s): (/home/xxxxxxx/:/tmp:/usr/local/lib/php/) in /usr/home/xxxxxxxxxx/domains/xxxxxxxxxxx.nl/public_html/sites/all/modules/fckeditor/fckeditor.module on line 786.
After downgrade to fck-editor 6.x-1.4 warning dissapear.

Comments

zacho’s picture

I second this. Seems like a bad path is being fed to file_exists?
edit: $themepath not being correctly set?

obris’s picture

same for me

Jorrit’s picture

Status: Active » Postponed (maintainer needs more info)

That's strange. What theme are you using? Where is the theme located?

Can you verify if the value $theme_key exists around line 1137 of fckeditor.module?

HowToHolidayCottage’s picture

I've got the same problem. I think I'll downgrade too, but being new to Drupal I'm not sure how to do a downgrade. Do you uninstall the module and then delete the module files, and then download the new module?

Or is there a quicker way?

zacho’s picture

As a logged-in user with working permissions to use FCKeditor, but on a page with no textareas, fckeditor.module is being processed with the $themepath variable set to null. This causes file_exists() to be called in two places with only the terminal portion of a path, namely "/fckstyles.xml" and later "/fckeditor.css".

(As the same user, but on a page with an FCKeditor-accessible textarea, it seems like fckeditor.module is getting processed twice -- once where $themepath doesn't get set (causing warnings) and once more where it gets set correctly.)

This looks to the operating system like we're searching for a file directly at root, and if open_basedir restrictions are in effect (as they are in many virtualhost commercial environments) the system throws the loud PHP warnings indicated by the original posting.

One can prevent PHP warnings from being spilled to screen by changing the error reporting settings (Administer > Site configuration > Error reporting), but it will still fill our logs with ugly messages that may raise the eyebrows of our hosting providers.

Moreover, this seems to somehow be causing FCKeditor to occasionally fail to load, though I can't explain that.

Also, this happens both in my normal theme (a Framework modification) and in Garland.

bjaast’s picture

same problem with "green and black" theme...
edit: it seems to me that the error fires on a page were fckeditor interface is set to simplified toolbar.

i.e. the error occurs on a page that contains the field addressed in fckeditor management area as:

*.edit-site-offline-message

and in similar pages.

Jorrit’s picture

The fckeditor_path_to_theme method is only used in the administrative panel and in the function that displays the editor. So having the error on a page without an FCKeditor looks impossible. Perhaps the Drupal error message comes from a different page view.
I still can't find out why this is happening. Does it happen for all text areas or just some?

Jorrit’s picture

the function fckeditor_path_to_theme was introduced to fix a problem when path_to_theme would in some cases not return the right result. Perhaps the following replacement helps your cases. Please let me know if it helps.

Replace the function fckeditor_path_to_theme (bottom of fckeditor.module) with:

function fckeditor_path_to_theme() {
  global $theme_key;
  static $themepath;
  
  if(empty($themepath) && !empty($theme_key)) {
    $themepath = drupal_get_path('theme', $theme_key);
  }

  // fall back
  if(empty($themepath)) {
    return path_to_theme();
  }
  
  return $themepath;
}

bwillia’s picture

Thanks Jorrit, your function seems to fix the problem!

Federico67’s picture

Ciao.

I've tried to update from fck-editor 6.x-1.4 to fck-editor 6.x-2.0. After update.php execution I've a notify in Status report that tell me "Database out of date". I repeat update.php execution more and more time but nothing happen: same notify appear in Status report.

Some suggestion?

Thanks

Jorrit’s picture

Federico67: could you open a new issue instead of posting a reply to this one? Your problem is unrelated to the problem of this issue.

Federico67’s picture

Ok, sorry

Summit’s picture

Subscribing, #8 is working. Will this be committed?
greetings, Martijn

PipB’s picture

Sorry for my late response: the theme i use is "Clean"
I haven't tried #8

bjaast’s picture

Yes it worked! Thanks a million.
Anyway it was happening only in those pages showing fckeditor with simplified toolbar, as I mentioned, in those pages whose path matched the paths listed in the administrative panel.

Thanks again, it looks like the problem is solved.

Summit’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Hi,

But still the #8 needs to be patched, right?

greetings, Martijn

PipB’s picture

I installled a new drupal on a new site with fckeditor 6.x-2.0 and it seems it was OK. But when i visit in admin > site-information and
site-maintenance the error appear:

file_exists() [function.file-exists]: open_basedir restriction in effect. File(/fckstyles.xml) is not within the allowed path(s): (/home/xxxxxx/:/tmp:/usr/local/lib/php/) in /usr/home/xxxxxx/domains/xxxxx.nl/public_html/sites/all/modules/fckeditor/fckeditor.module on line 786.

I use theme Clean in themes/clean

I replaced in fckeditor.module at the bottum the code:


function fckeditor_path_to_theme() {
global $theme_key;
static $themepath;

if(empty($themepath)) {
$themepath = drupal_get_path('theme', $theme_key);
}

return $themepath;
}

by #8

Error is disappeared
Thanks!!!

Jorrit’s picture

Status: Reviewed & tested by the community » Fixed

It has been committed to the 2.0 branch

exile_ch’s picture

yes good one. 8 helped

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gultig’s picture

Thank you it worked for me.

roman-drupal’s picture

#8 Worked for me aswell - great job!
Thanks
R

vir_2’s picture

#8 worked for me too
thanks

Munkhbuyan’s picture

Component: Code » User interface
Assigned: Unassigned » Munkhbuyan