Fix WordPress Files & Folders Permission Massively On cPanel Server


chdir("/var/cpanel/users");
$users = glob('*');
foreach($users as $user)
{
if(is_file("/home/$user/public_html/wp-config.php"))
{
echo "Performing on /home/$user/public_html\n";
system("find /home/$user/public_html/ -type d -exec chmod 755 {} \; ");
system("find /home/$user/public_html/ -type f -exec chmod 644 {} \; ");
}
}

Save the file as fix.php on /root
Then execute it

/usr/local/cpanel/3rdparty/bin/php /root/fix.php

Leave a Reply

Your email address will not be published.