Control Web Panel

Developers => New Modules => Topic started by: rcschaff on May 15, 2020, 02:11:14 AM

Title: [SCRIPT] fix_500
Post by: rcschaff on May 15, 2020, 02:11:14 AM
The following script should work to fix the dreaded error 500 CWP issue on both CentOS 6 and 7 automatically

1) login as root
2) nano /scripts/fix_500
3) paste contents below
4) chmod 700 /scripts/fix_500
5) run /scripts/fix_500

Code: [Select]
#!/bin/bash
yum -y update cwpphp --enablerepo=cwp
cos=`uname -r | grep -oP "el\K(.)"`
ver=`grep "version" /usr/local/cwpsrv/htdocs/resources/admin/include/version.php | cut -d "\"" -f 2`
case $cos in
[6]*)
        echo "CentOs $cos running CWP $ver"
        chattr -i -R /usr/local/cwpsrv/htdocs
        cd /usr/local/cwpsrv/htdocs
        wget dl1.centos-webpanel.com/files/cwp/cwp2-$ver.zip
        unzip -o cwp2-$ver.zip
        rm -f cwp2-$ver.zip
;;
[7]*)
        echo "CentOs $cos running CWP $ver"
        chattr -i -R /usr/local/cwpsrv/htdocs
        cd /usr/local/cwpsrv/htdocs
        wget static.cdn-cwp.com/files/cwp/el7/cwp-el7-$ver.zip
        unzip -o -q cwp-el7-$ver.zip
        rm -f cwp-el7-$ver.zip
        ;;
*)
        echo "Not CentOs"
        ;;
esac
chattr -R -i /usr/local/cwpsrv/var/services/
cd /usr/local/cwpsrv/var/services/
wget static.cdn-cwp.com/files/cwp/el7/cwp-services.zip
unzip -o -q cwp-services.zip
rm -f cwp-services.zip
sed -i "s/ioncube_loader_lin_7.0/ioncube_loader_lin_7.2/g" /usr/local/cwp/php71/php.ini
sh /scripts/restart_cwpsrv
sh /scripts/update_cwp
Title: Re: [SCRIPT] fix_500
Post by: ddelbiondo on June 05, 2020, 03:37:41 PM
Thank you for the fix.
Title: Re: [SCRIPT] fix_500
Post by: Adilson on August 07, 2020, 06:28:14 PM
Hi Guys,
Thanks for this information, but unfortunately do not solve my problem!
Title: Re: [SCRIPT] fix_500
Post by: Freespirits_GR_Host on November 01, 2022, 02:12:34 PM
Tested the above script as i am unable to use cpanel.domain and get 500 error page, but no luck.
The error from CWP logs is

Code: [Select]
FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Twig_Error_Loader: The "/usr/local/cwpsrv/var/services/users/cwp_theme/undefined" directory does not exist ("/usr/local/cwpsrv/var/services/users/cwp_theme/undefined"). in /usr/local/cwpsrv/var/services/twig/lib/Twig/Loader/Filesystem.php:101
Stack trace: