Test PHP Version only on Staging Site
-
Can I test upgrading PHP on ONLY the Staging site without affecting the live site? I am concerned about several very important plugins not being compatible with 8.3 and do not want to risk updationg live and then trying to figure out how to downgrade if needed.
Thanks so much.
-
Hi @rebop,
Yes, you can test a different PHP version on the staging site without affecting the live site, depending on your hosting provider. Some hosts allow you to override the PHP version per directory using a
.htaccessfile.If your host supports it, try adding this line at the top of the
.htaccessfile in your staging subdirectory:AddHandler application/x-httpd-php83 .phpReplace
php83with the actual handler your host uses for PHP 8.3. If this doesn’t work, your host may require changing the PHP version through their control panel. Please check with them directly.Let us know if you need further assistance!
Cheers!
FayyazThanks so much. That is very helpful!
~Bob
Forgive me, need to ask another question:
What happened was I was manually updating my plugins. WP Staging was one of them. I ran an update after and it generated a 1.3GB error log. All WP Staging errors. I panicked a bit. I deleted the staging site and created a new one, though it did not use the name of the previous staging site nor did it ask for a name. It calls it ENTERPRISE!
It no longer throw errors (and I deleted that 1.3 GB file) but would like to change that name for the staging site. Can I ?
And forgive me again, but need to circle back to changing PHP for a moment. I reached out to my host and pretty amazing AI answers. Their initial response said:
Good morning! We’re here to help with your staging site question. Yes, you can change the PHP version for only your XXXHOST Cloud Staging Site to test updates with your plugins. If you encounter any issues, you can easily switch back to a previous PHP version.
Here’s how to do it:
- Log in to your XXXHOST Account Manager.
- Navigate to the Hosting tab and click MANAGE on the site with the staging environment.
- Click the STAGING tab to access your staging site settings.
- Go to the SETTINGS navigation tab.
- Click the CHANGE PHP VERSION button.
- Select the desired PHP version from the dropdown (e.g., PHP 8.1 to PHP 8.4).
- Click APPLY to save the change.
If you need to revert, just repeat these steps and select the previous PHP version.
I replied:
Wow, interesting AI 🙂 Only other note is I created the staging site with WP Staging plugin, not XXXHOST Cloud. Does that make any difference?
To which they replied:
We understand you’re using the WP Staging plugin instead of XXXHOST Cloud for your staging site. Yes, that does make some difference:
- Hosting Control: WP Staging is a third-party plugin that creates a staging site within your existing hosting environment, but it has limited control over server resources compared to XXXHOST Cloud Staging, which allocates separate resources for staging.
- Location: WP Staging stores the staging site on your server or sometimes on their servers, whereas XXXHOST Cloud Staging creates a fully isolated environment managed within XXXHOST’s infrastructure.
- Deployment Process: With WP Staging, you use the plugin’s interface to push changes from staging to live, while XXXHOST Cloud Staging offers a swap feature that can be faster and allows you to revert easily.
- Privacy & Security: XXXHOST Cloud Staging environments are private and isolated, while WP Staging sites may require additional steps to ensure they are password-protected and not indexed by search engines.
- Feature Limitations: Some features like Jetpack may behave differently or be disabled in XXXHOST Cloud Staging, but this depends on the staging method.
In summary, WP Staging works well for many users, especially for smaller sites or those preferring plugin-based solutions. XXXHOST Cloud Staging offers more robust resource management and seamless integration with your hosting account.
If you want, we can guide you on how to manage or deploy changes using WP Staging or help you explore XXXHOST Cloud Staging for future use.
So, I assume I can do this for the WP Staging site in CPanel. Just thought this interesting and wanted to confirm I can try. The WP Staging site is listed and appears to have its own controls.
Thanks. Sorry for such a long post.
I was not able to find the staging site separately in CPanel MultiPHP manager. While the staging site does appear under DOMAINS, clicking mange there is a panel that seems to affect everything, not just the Staging Site.
I can FTP to the site, then Staging subfolder. There is an .htaccess there. It says:
(cannot paste as it is so a screenshot – and funky at that – and that will not work!!)
http://www.in4m8n.com/Staging_htaccess.jpg
Should I edit this? Where since most seems commented out?
Thanks.
-
This reply was modified 9 months, 1 week ago by
rebop.
Hi @rebop
From what you have mentioned, it seems to me the staging site you created with WP STAGING plugin won’t have the same hosting company staging site features.
You need to ask your hosting provider if they support adding “AddHandler application/x-httpd-php83 .php” to the .htaccess file or not.
Also, ask them if they support changing PHP version per subdirectory or not (this is a general question without digging deep into if it’s a staging site created using a third party plugin or not).
Regarding your earlier question here. Well, we need to look at this large log file or at least the last few lines of it, but unfortunately, you deleted it. By default -if you didn’t choose a name for your staging site- WP STAGING plugin will assign a random name to it. (Check this screenshot).
There is no option to change the staging site name in WP STAGING (the free version), however, you can delete the staging site and create a new one and take care to enter a name as in the screenshot I showed above.
Thanks,
AlaaThanks so much for the reply.
I my Staging Site named and it never changed. through various updates, deletes, fresh starts This time, with updated version off WP Staging I did not see a place to name, so assumed it would be the same as it always was. Likely I just missed it. Particularity in the heat of the moment trying to stop the runaway Error file 🙂 My impression is that most of the error lines said “does not exist” and I am assuming it was a compatibility with trying to update the existing staging site with the new update. At least that part is over.
I’ll contact host to see what I can do about PHP.
Thanks again.
The topic ‘Test PHP Version only on Staging Site’ is closed to new replies.