SOLVED Weird things with PHP in new subdomains, after importing WHM settings, and cPanel account to CentOS7 from 6

jasoncollege24

Active Member
Mar 25, 2012
27
3
53
Portsmouth, Virginia, United States
cPanel Access Level
Root Administrator
All existing domains, and subdomains seems to be working fine. also phpinfo() seems to work, but no other php sites/pages on new subdomains seem to work.

Here's what happened:

* used the cpanel configuration tool to backup the whm config, and the cpanel backup wizard to make a backup of my entire cpanel account.
* wiped old OS, and installed CentOS7
* installed cpanel
* logged in to ssh, and imported WHM configuration using the same tool
* logged into WHM, and imported my cPanel account
* Added php7.3, all the way up to 8.0, keeping 5.6, 7.1, and 7.2

All other sites and services on the server are working as expected, including PHP websites, but when I create a new subdomain, and added a new php website, i either get HHTP 500 errors (with errors like these in the apache error log "[core:error] [pid *****] [client IP:PORT] End of script output before headers: index.php") or blank white pages, with nothing in any error logs.

One such php site is called Nova 2, by Anodyne Productions. I have working copies on multiple subdomains, but if I try to add a brand new install to a new subdomain, created after the account transfer, all I get is a white page.

This makes zero sense to me, and this functionality is needed, if I'm going to make anymore subdomains. Any help would be appreciated.
 

jasoncollege24

Active Member
Mar 25, 2012
27
3
53
Portsmouth, Virginia, United States
cPanel Access Level
Root Administrator
Unless I misunderstood the documentation, the cpconftool was supposed to handle that for me.

I tried to get help/advice before in February of this year about moving my server to an updated OS, (elsewhere on the forums), and was told that it was as easy as installing the OS, installing cpanel, and restoring the backup.

your question tells me that answer may have been wrong.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,504
567
273
cPanel Access Level
Root Administrator
I think your statement of "used the cpanel configuration tool to backup the whm config" needs some additional clarification. Can you let me know exactly what you did there? If you're using the tool as outlined here:


That would not make a backup of the PHP settings on the system. For EasyApache, it would have been best to download a copy of the profile.

I much prefer to use the Transfer Tool to move everything automatically through that system, but when you're reimaging and restoring to the same hardware it can be more complicated than a standard migration as you don't have your original settings to reference.

But in this case, for clarification, the cpconftool is not enough to move all those settings over.
 

jasoncollege24

Active Member
Mar 25, 2012
27
3
53
Portsmouth, Virginia, United States
cPanel Access Level
Root Administrator
Actually, I followed the instructions Here, because version 76 was the first search result for exporting WHM settings. I've also never ever done this before, and was originally hoping I could do this with a familiar distro, like ubuntu, but cpanel doesn't support it.

on old OS:
Code:
cpconftool --list-modules
cpconftool --backup --modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::autossloptions,cpanel::system::backups,cpanel::system::greylist,cpanel::system::hulk,cpanel::system::modsecurity,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes
on new OS:

Code:
cpconftool --restore=/home/jasoncollege24-whm-config-backup-2020.tar.gz --modules=cpanel::easy::apache,cpanel::smtp::exim,cpanel::system::autossloptions,cpanel::system::backups,cpanel::system::greylist,cpanel::system::hulk,cpanel::system::modsecurity,cpanel::system::mysql,cpanel::system::whmconf,cpanel::ui::themes --prerestore_backup
As it turns out, there was a LOT it didn't backup. I spent that whole night manually resetting MANY settings in WHM, which was the whole reason I was looking for a way to migrate my settings.

This also doesn't explain why I can take an existing (verified fully working) PHP website from another subdomain (or domain) on my server, designed to be 100% movable, copy it into a brand new subdomain (created after the restore) and it just... fails with a white blank window, and no errors of any kind. This only seems to be a problem with new subdomains, as all domains, and subdomains created before the backup are working perfectly fine, after the restore.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,504
567
273
cPanel Access Level
Root Administrator
If the PHP is giving a white page, I would expect either an error message to be logged or a memory limit being reached. Is there nothing logged in the main /etc/apache/logs/error_log file when you visit the site that is showing a blank page?
 

jasoncollege24

Active Member
Mar 25, 2012
27
3
53
Portsmouth, Virginia, United States
cPanel Access Level
Root Administrator
uhh... weirdness... after several hours, the situation appears to have resolved itself. I can now upload my custom PHP software, or copy the existing site to the new location, and it functions as originally expected, with no unusual errors.

Could this have been a DNS propagation issue, somehow caused by the reimaging? FWIW my nameservers are handled by the server itself, instead of being elsewhere on the internet. (eg NS1, and NS2 are using my server's own IP addresses, instead of using any external nameservers. This has served me well in the past.)