[SCRIPT] fix_500

Started by rcschaff, May 15, 2020, 02:11:14 AM

Previous topic - Next topic

rcschaff

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

#!/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
Google Hangouts:  rcschaff82@gmail.com

ddelbiondo


Adilson

Hi Guys,
Thanks for this information, but unfortunately do not solve my problem!

Freespirits_GR_Host

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

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:


You need a reliable hosting company for your website or your eshop?
Need a cheap, reliable, fast and secure hosting?
You want fast support and action to every technical issue?
Freespirits is here for you :) - Don't look any further!

dilhan

Fix is simple for me.

Login to CWP admin panel. Then go to Features, Theme, Languages > Themes and choose original as the user theme, then click Save Theme Default.

overseer


Jamshed Datori

Quote from: overseer on November 08, 2026, 08:43:10 PMIs rcschaff still around?

I have direct contact with him on WhatsApp, and I will see if he is still up in this field.

rcschaff

I'm around here and there lurking.

To fix this issue, you need to create a file cwp.ini in the users home dir
EX:  /home/{user}/.conf/cwp.ini with the following information

LANG=en
THEME=original
EMAIL=

cwp.ini should be chmod 644 and owned by the user/group of the user.  .conf should be 755 owned by user/group
Google Hangouts:  rcschaff82@gmail.com