WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] "Warning! PHP safe mode enabled!"... but safe mode is OFF (8 posts)

  1. notoriousxl
    Member
    Posted 6 years ago #

    Hi :)

    I've installed WordPress MU (latest RC1 version) in my ftp space, with php5 and safe_mode=OFF. I've also installed WP Super Cache in mu-plugins directory, following the instructions step-by-step.

    However, the plugin's configuration page returns me the error:

    Warning! PHP safe mode enabled!

    You may experience problems running this plugin because SAFE MODE is enabled. Your server is set up to check the owner of PHP scripts before allowing them to read and write files.

    You or an administrator may be able to make it work by changing the group owner of the plugin scripts to match that of the web server user. The group owner of the wp-content/cache/ directory must also be changed. See the safe mode manual page for further details.

    What should I do? :(

    PS: sorry for my bad English, I'm Italian... :P

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    If WP Super Cache says safe mode is on, then safe mode is on. Period. That's all there is to it, and you are mistaken if you think it's off.

    Here's the code it uses:

    if( ini_get( 'safe_mode' ) ) {
       ?><h3>Warning! PHP safe mode enabled!</h3>
    ...

    Simple as that, really.

    Why do you think safe mode is off?

  3. notoriousxl
    Member
    Posted 6 years ago #

    @Otto42: thanks for the answer! ;)

    Why do you think safe mode is off?

    'Cause the output of phpinfo() says it: http://technoburger.net/test.php :?

  4. notoriousxl
    Member
    Posted 6 years ago #

    Sorry for the double post...
    A little modification to wp-cache.php (line 101) seems to solve the problem:
    if( ini_get( 'safe_mode' ) != 'off' ) { //if( ini_get( 'safe_mode' ) ) {
    I think the second if should be edited, too:
    if( !ini_get( 'safe_mode_gid' ) ) {

    If you think that this modification is safe, I'll activate the plugin... ;)

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    No no, that's not what I meant. I don't care what phpinfo() says, I'm interested in the actual setting itself. Where and how did you disable safe_mode?

    See, safe_mode is a flag, setting it to "on" or "off" in the php.ini is incorrect. It should be set to one or zero instead. If it's set to the string of "off" then the results are not entirely predictable.

    PHP's own documentation on safe mode:
    http://php.net/features.safe-mode

    Some versions of PHP do interpret "On" and "Off" in the config file as 1 and 0, but these vary a lot, which is why 1 and 0 is best.

  6. notoriousxl
    Member
    Posted 6 years ago #

    @Otto42: I don't have the control of the server, I've got only ftp access ;-) (it's a shared hosting)... so editing wp-cache.php file is the only thing I can do, I suppose ;)

    Should I change anything else, before activating the plugin? :)

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    You don't even need to change that, actually. It's just a warning, it doesn't actually prevent anything from working.

    Super cache has several checks in it like that.

  8. notoriousxl
    Member
    Posted 6 years ago #

    Ok, thanks! ;)

Topic Closed

This topic has been closed to new replies.

About this Topic