WordPress thinks my PHP is older version
-
WordPress will not update because it thinks I have PHP version 5.6.4. When I log into my GoDaddy PHP admin page it says I have PHP version 8.1.16.
from searching the web, I think the issue is with my .htaccess file, but I don’t know how to repair it.
-
If WordPress “thinks” your PHP version is older, chances are your running PHP version is indeed older. WordPress merely reports the PHP version in use: it doesn’t control what gets used. Your web server does.
The likely scenario is that you have multiple versions of PHP installed, and you have some code in your
.haccessfile (or some other user-level configuration file) that’s pointing your web server to use the older 5.6.4 version.from searching the web, I think the issue is with my .htaccess file, but I don’t know how to repair it.
Get in touch with your hosting provider to help you resolve this.
Hi @cinbrandon,
You can verify what the current PHP version of your WordPress website is. Just follow these steps:- Navigate to your WordPress dashboard.
- Go to Tools > Site Health.
- Site Health > go to Info tab.
- Scroll down until you see the Server option.
- You may see the PHP version in the information provided. See image: https://share.zight.com/nOuJD7dp.
Also, before you update the PHP version of your website, make sure you have the latest backup of your website, just in case.
You can try to recreate a new .htaccess file. Since you can access your hosting account,.- Go to the file manager.
- Under the public_html folder, find a .htaccess file and rename it to .htacess_old.
- Save the file.
- Go back to your WordPress dashboard.
- Go to Settings > Permalinks.
- Then, click on the ‘Save Changes’ button without changing the permalink structure settings.
- WordPress will now try to generate the .htaccess file for you.
Please try the recommended solution and let me know how it goes.
Warm regards,
@gappiah, I’ve chatted with Godaddy. They assure me I have PHP v8.1.16. They said the issue is with the .htaccess file, but would not help beyond that.
@jerrymayalor555, WordPress is reporting PHP v5.6.4. I followed your second set of steps, but after I changed the .htaccess file name, I could no longer access my site, even in the WP admin panel.-
This reply was modified 2 years, 4 months ago by
cinbrandon.
-
This reply was modified 2 years, 4 months ago by
cinbrandon.
What is the content of your .htaccess file?
To get that, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and open the .htaccess file with a plain text editor.
If you can’t find a .htaccess file, ensure that you have set your SFTP or FTP client to view invisible files.
I’ve tried “#” on the the addhandler line. I also tried moving the addhandler line to top, before “# begin wordpress”
RewriteEngine on # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress AddHandler application/x-httpd-alt-php56___lsphp .php DirectoryIndex default.html default.htm index.php index.shtml index.html index.htm home.html home.htm index.php5 welcome.html welcome.htm Options -IndexesYeah, your problem is:
AddHandler application/x-httpd-alt-php56___lsphp .phpIf you’ve already configured a higher PHP elsewhere, just delete that line.
If you run into an issue with the site after deleting that line, set your desired PHP version in your hosting account’s control panel one more time.
@macmanx, I’ve deleted that line, website crashed. I’m trying to see where to set the PHP in hosting control panel. I just see that it’s version 8.1.16 in phpMyAdmin
You mentioned you’re with GoDaddy, so follow these guides depending on which GoDaddy product you’re with: https://www.godaddy.com/help/update-php-to-the-latest-version-20198
thank you.
I’ve tried 4 different versions. 5.6, 7.3, 7.4, 8.2. No matter the PHP version, WordPress thinks I have 5.6 and won’t update.
When you remove that line from .htaccess, then set PHP 8.2, what does your .htaccess file say?
I removed the line. saved htacess.
Updated to PHP 8.2. Open file and it looked the same, without the line there. Website not working.
added line back and it works, but WordPress still thinks it’s PHP 5.6but WordPress still thinks it’s PHP 5.6
Can you send a sample screenshot for this issue?Make sure the permissions on the .htaccess file are 666: https://developer.ww.wp.xz.cn/advanced-administration/server/file-permissions/
It needs to be either 666 or 777 to be writable by something like cPanel modifiers.
@jerrymayalor555 I don’t see a way to attach an image here. But here’s the line: “You cannot update because WordPress 6.4.3 requires PHP version 7.0.0 or higher. You are running version 5.6.40.”
How about a link to your website so that I could verify it using browser developer tools.
Thanks
The topic ‘WordPress thinks my PHP is older version’ is closed to new replies.