• Resolved winterstreet

    (@winterstreet)


    I’ve seen this before and usually upgrading the version of php fixes it. In this case the site is using 5.4.43 and phpinfo says as much, but I still can’t get wp-spamshield to activate it says I’m running php 5.2, to be fair I’m getting the same message from another plugin so I don’t think it’s a spamshield problem, but has anyone seen something like this before.

    https://wordpress.org/plugins/wp-spamshield/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor redsand

    (@redsand)

    Hi winterstreet,

    Yes, this is something we’ve definitely seen before.

    It’s not an issue with the plugin.

    The short answer: It’s most likely an .htaccess file configuration conflict.

    The PHP version reported by the plugin is correct. However, that doesn’t mean you’re wrong either. I’ll explain.

    The PHP version is reported directly by the system, so it is always going to be correct. That is not something we can make a mistake on. If you’re getting the same version number from another plugin as well, you need to trust that.

    I checked out your site from the link in your profile. On your web host (as with most good hosts these days) there is more than one version of PHP available, and by changing the configuration in your .htaccess file, you can use different versions of PHP at runtime.

    So when you ran your phpinfo() test, you may well have been running PHP 5.4.43. Just an FYI, PHP 5.4 and 5.5 have also reached end of life (EOL), which means they are no longer being supported by the PHP team nor are they receiving security updates. I would recommend upgrading to PHP 7, or at least 5.6. (PHP 7 is over twice as fast as 5.6…you will most likely really like it.) If you have any issues with PHP 7 compatibility, you’re fine to stick with 5.6…it should be a problem-free upgrade from 5.4.

    The most likely scenario is that you have conflicting configurations in two different .htaccess files. There is most likely an .htaccess file in the root of your site that is set to use PHP 5.4. The .htaccess file in your WordPress directory is likely set to use PHP 5.2. You will need to check it for any lines there that look similar to this:

    AddHandler application/x-httpd-php52 .php

    If you find something like that, remove it.

    Keep in mind that .htaccess files in subdirectories will override any .htaccess in the root.

    If you don’t find the offending .htaccess file, then you can do the following:

    1. Install our plugin, RS System Diagnostic.
    2. Use the “Switch to Advanced View” button. That will detect all your .htaccess files and include them in the data.
    3. Download the generated text file to your computer.
    4. Search it for the line above line of code mentioned above, or anything referencing PHP 5.2.
    5. If you still can’t find it at this point, you’ll need to contact your web host’s tech support. Your particular host has good support, and should be able to help you fix the issue.

    Once you get it fixed, to prevent issues like this in the future, you want to only specify PHP handlers (aka PHP version) in your root .htaccess, so that other .htaccess files won’t cause conflicts if you switch versions again later on.

    I hope this info helps!

    – Scott

    Thread Starter winterstreet

    (@winterstreet)

    Thank you for the detailed response.

    There is an htaccess file in the root directory (and it says 5.4). The root directory is the wordpress directory. But I looked in the wp-admin folder and there’s was a .htaccess file. It did not specify a php version but had something else in there. Unfortunately I didn’t note what it was before deleting it. But removing that file fixed the problem. I think it was left over from a security plugin or maybe added by the host.

    By the way I tried to install the RS System Diagnostic plugin and it would deactivate just like the others because of the version of php.

    Plugin Contributor redsand

    (@redsand)

    You’re very welcome!

    I’m glad you were able to fix the issue.

    Have a good one. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Message is wrong on the version of php’ is closed to new replies.