David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
Hi,

I have around 30 Wordpress sites on a dedicated server, php version is currently 5.6 and its running Easy Apache 3 and I would like to upgrade the server to php 7.

From what Ive read I just need to upgrade to EA 4 via my WHM admin end and then upgrade to php 7 via ssh to the sever, is there anything else I need to be aware of?

Most of the WP sites are just basic content blogs running Genesis themes and with no specific plugins, I have installed and run WP Engine's PHP Compatibility Checker plugin on a few of the sites and not seen any conflicts so far.

thanks
 

David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
of course I decided instead of waiting for an answer to instead charge ahead and do the upgrade anyway and everything then broke :)

After running the migration to EasyApache 4 via WHM nearly all my sites were down and showing this message:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

so Ive just done a roll back to EA3 and everything back to normal, phew!

So, what do I need to do before doing the migration again but this time making sure that MYSQL doesnt break? I did some Googling and saw some people mention symlinks to modules eg here?

cPanel with PHP selector shows WordPress Error "PHP installation appears to be missing the MySQL extension which is required by WordPress"

also why were some sites ok?

Im currently on 5.5.58-MariaDB
 

David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
So I have been doing some reading here on the forums and found this

MySQL extension missing

after looking at the sites that had this problem and the ones that didnt I can see in the .htaccess files on the sites that went down with the mysql problem after the EA4 migration they have both suPHP_ConfigPath blocks in as well as Wordfence firewall ones eg

Code:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/nineoh
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# Wordfence WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
</IfModule>
</Files>

# END Wordfence WAF

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
#   AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
so, I guess I need to delete those two blocks from all .htaccess files for all my sites before doing the EA4 migrate again?

thanks
 

David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
one other thing, I just ran the EA4 pre-flight check again and it returns the following, can they be ignored?

Pre-flight check result.

Cpanel Migrate Blocker (Cpanel)
Cpanel evaluates known issues such as network connectivity

Warning: “Cpanel::Easy::PHP5::MailHeaders” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::PHP5::MagicQuotes” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::Apache::SlowRestartPatch” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::Apache::Fileprotect” ignored since it does not have an RPM.
Warning: Current profile has the following MPMs: ea-apache24-mod_mpm_prefork
Warning: Adding the missing package, ea-apache24-mod_suexec, to the EasyApache 4 profile.

I also found this article which addresses the WP MYSQL extensions issue, however it talks about making these changes after migrating, is there anyway to do this before to save downtime?

How to Update EasyApache 3 to EasyApache 4 | InMotion Hosting
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello,

so, I guess I need to delete those two blocks from all .htaccess files for all my sites before doing the EA4 migrate again?
You could start by removing the suphp block first, as I don't believe the WordFence entries are leading to the error messages you reported.

Warning: “Cpanel::Easy::PHP5::MailHeaders” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::PHP5::MagicQuotes” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::Apache::SlowRestartPatch” ignored since it does not have an RPM.
Warning: “Cpanel::Easy::Apache::Fileprotect” ignored since it does not have an RPM.
Warning: Current profile has the following MPMs: ea-apache24-mod_mpm_prefork
Warning: Adding the missing package, ea-apache24-mod_suexec, to the EasyApache 4 profile.
These are non-fatal warnings and discussed on the following thread:

EA3 to EA4 warnings, should I worry?

Thank you.
 

David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
Hello,



You could start by removing the suphp block first, as I don't believe the WordFence entries are leading to the error messages you reported.



These are non-fatal warnings and discussed on the following thread:

EA3 to EA4 warnings, should I worry?

Thank you.
Ok thanks, I ran the EA4 update again and then all the php module updates after and all seems ok now.

Just one last question, when I did the EA4 migrate in WHM I saw lots of errors like this in the output after, is this anything I need to fix?

(XID uqm7jb) The system failed to set the permissions on “/home/myasus” to “0711” (as EUID: 533, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
(XID z33azh) The system failed to set the permissions on “/home/hollyw” to “0711” (as EUID: 534, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
(XID 3kwxg4) The system failed to set the permissions on “/home/itsecure” to “0711” (as EUID: 536, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
(XID hgj539) The system failed to set the permissions on “/home/geeks” to “0711” (as EUID: 537, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
(XID dj2bev) The system failed to set the permissions on “/home/english” to “0711” (as EUID: 538, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
(XID qkbtxy) The system failed to set the permissions on “/home/studydrive” to “0711” (as EUID: 539, EGID: 99 99) because of the following error: Operation not permitted at /usr/local/cpanel/scripts/enablefileprotect line 101.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello,

What are the permission and ownership values on your /home partition? EX:

Code:
stat /home
grep home /etc/fstab
Thank you.
 

David_spm

Well-Known Member
May 28, 2017
57
0
6
Thailand
cPanel Access Level
Root Administrator
Hello,

What are the permission and ownership values on your /home partition? EX:

Code:
stat /home
grep home /etc/fstab
Thank you.
sorry I missed this, here is the output for stat /home


Code:
 File: `/home'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 803h/2051d      Inode: 9961473     Links: 86
Access: (0711/drwx--x--x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2011-09-23 07:50:20.000000000 -0400
Modify: 2017-12-19 03:28:03.032998324 -0500
Change: 2017-12-19 03:28:03.032998324 -0500
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello,

It's likely that files within the account home directories referenced in that output have an invalid UID or are not owned by the account username. To correct this, ensure the ownership of those files matches the default file ownership settings that you see when creating a test account.

Thank you.