Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: daro2013 on July 17, 2018, 10:28:44 AM

Title: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 10:28:44 AM
Hi sir,

I have installed CWP on both CentOs 6 64bits and CentOs 7 64bits, both generate php errors in CWP panel. I can confirm that the installation went well without errors, and I managed to create DNS records, a Database, username with password for an application in PhpMyAdmin.

However, these errors are shown in CWP panel for some reasons:

Warning: mysqli::__construct(): (HY000/1049): Unknown database 'oauthv2' in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Notice: Trying to get property of non-object in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0


I also can confirm that I have checked the password in these two files:

$ cat /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
$ cat /root/.my.cnf

they are the same and the same as root mysql password generated by CWP after the installation is complete.

Can you please help guide me how to fix that?

Cheers
Thon
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 10:56:07 AM
navigate to /var/lib/mysql and see if oauthv2 exist or not. The error shows that this database doesnt exist.
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 11:07:20 AM
hi,

Thank you for your help.

There is no such a file:

/var/lib/mysql

on my server. What it could be?

Cheers
Thon
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 11:20:05 AM
what is output of this command

Code: [Select]
ls -la /var/lib/mysql
Also this command

Code: [Select]
mysql
SHOW VARIABLES LIKE 'datadir';
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 11:26:05 AM
Hi,

Here are the inputs:

[root@vps69091 include]# ls -la /var/lib/mysql
total 110672
drwxr-xr-x   8 mysql mysql     4096 Jul 17 06:15 .
drwxr-xr-x. 34 root  root      4096 Jul 17 05:04 ..
-rw-rw----   1 mysql mysql    16384 Jul 17 06:15 aria_log.00000001
-rw-rw----   1 mysql mysql       52 Jul 17 06:15 aria_log_control
-rw-rw----   1 mysql mysql 12582912 Jul 17 06:15 ibdata1
-rw-rw----   1 mysql mysql 50331648 Jul 17 06:15 ib_logfile0
-rw-rw----   1 mysql mysql 50331648 Jul 17 05:00 ib_logfile1
drwx------   2 mysql mysql     4096 Jul 17 05:19 mailwizz
-rw-rw----   1 mysql mysql        0 Jul 17 05:01 multi-master.info
drwx--x--x   2 mysql mysql     4096 Jul 17 05:00 mysql
srwxrwxrwx   1 mysql mysql        0 Jul 17 06:15 mysql.sock
drwx------   2 mysql mysql     4096 Jul 17 05:00 performance_schema
drwx------   2 mysql mysql     4096 Jul 17 05:02 postfix
drwx------   2 mysql mysql     4096 Jul 17 05:02 root_cwp
drwx------   2 mysql mysql     4096 Jul 17 05:04 roundcube
-rw-rw----   1 mysql mysql    24576 Jul 17 06:15 tc.log
-rw-rw----   1 mysql mysql        6 Jul 17 06:15 vps69091.pid


-> SHOW VARIABLES LIKE 'datadir';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'olF5rZVkFN3d
SHOW VARIABLES LIKE 'datadir'' at line 1


Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 11:30:18 AM
oauthv2 database doesnt exist on your server thats why its giving error.
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 11:33:06 AM
Hi,

Thanks for your help.

What is the solution to that?

Cheers
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 11:49:33 AM
Update:

I created that database in PhpMyAdmin:

oauthv2

The first warning has gone. But the second notice is still there:

Notice: Trying to get property of non-object in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0


How can I fix that?

Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 11:51:21 AM
Login to phpmyadmin with your root password.

Code: [Select]
http://serverip:2030/pma
Navigate to create database

Code: [Select]
http://serverip:2030/pma/server_databases.php
Create database.

Code: [Select]
oauthv2 as latin1_swedish_ci
Download the attached database and import in it.

Code: [Select]
http://send.bullten.net/download/3e2027b25812432019042b2d10b771a5.html
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 11:58:00 AM
Hi,

It is FIXED!

Thanks for great help.

Why this has happened?

Cheers
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 12:17:13 PM
Update:

New warnings coming:

2018-07-17 10:49:39 Danger: ModSecurity - SECURITY ISSUE
Mod Security is NOT enabled on your server, click here to enable it.
◊2018-07-17 10:49:39 Danger: Firewall - SECURITY ISSUE
CSF/LFD Firewall is NOT enabled on your server, click here to enable it.
◊2018-07-17 10:49:39 Danger: Hidden Processes - SECURITY ISSUE
Hide all processes if not owned by the user is NOT activated on your server, click here to enable it.


Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 12:26:04 PM
Just warning. Enable those functions if you need.
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 12:57:12 PM
thanks.

I just closed those warnings and refresh cwp browser, they have gone.

Many thanks again for great help.

Cheers
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 01:21:01 PM
Update:

After I created a user in CWP panel which will automatically created an FTP server with a default index.html. It seem not working when I tried to access that page at:

http://www.mydomain.com/index.html

it generates:

"This site canít be reached"


What could be wrong with that?
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 01:29:49 PM
Update:

I have to issue the following commands:

[root@vps69091 ~]# service named reload && /etc/init.d/named restart
Redirecting to /bin/systemctl reload named.service
Job for named.service invalid.


they generate errors.

It seems that named has been moved?

Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 04:12:11 PM
What is output of

Code: [Select]
yum list installed | grep bind
And

Code: [Select]
serivce named restart
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 17, 2018, 07:58:40 PM
a. Here are the outputs of the commands:

[root@vps196134 ~]# yum list installed | grep bind
bind.x86_64                           32:9.9.4-61.el7                  @base
bind-libs.x86_64                      32:9.9.4-61.el7                  @base
bind-libs-lite.x86_64                 32:9.9.4-61.el7                  @base
bind-license.noarch                   32:9.9.4-61.el7                  @base
bind-utils.x86_64                     32:9.9.4-61.el7                  @base

[root@vps196134 ~]# serivce named restart
-bash: serivce: command not found



b. And here the DNS config I did in CWP panel:

$TTL    38400
@       IN      SOA     ns1.mydomain.com.   admin.mydomain.com. (
                        20170922110026 ; serial
                        90M ; refresh
                        15M ; retry
                        14D ; expire
                        3600 ; default_ttl
                        )
 
mydomain.com.   14400   IN   NS   ns1.mydomain.com.
mydomain.com.   14400   IN   NS   ns2.mydomain.com.
 
ns1   14400   IN   A   xxx.xxx.xxx.xxx
ns2   14400   IN   A   xxx.xxx.xxx.xxx
 
mydomain.com.   14400   IN   A   xxx.xxx.xxx.xxx
 
localhost   14400   IN   A   127.0.0.1
 
mydomain.com.   14400   IN   MX   0   mydomain.com.
 
server   IN   A   xxx.xxx.xxx.xxx
www   IN   A   xxx.xxx.xxx.xxx
 
mydomain.com.   IN   TXT   "v=spf1 a mx ptr a:mydomain.com ip4:xxx.xxx.xxx.xxx ?all"

_adsp._domainkey.mydomain.com.   IN   TXT   "dkim=all"

_domainkey.mydomain.com.   IN   TXT   "o=~; r=abuse@mydomain.com"

_dmarc.mydomain.com.   IN   TXT   "v=DMARC1; p=quarantine; sp=r; pct=100; aspf=r; adkim=s"


default._domainkey   IN   TXT   ( "v=DKIM1; k=rsa; "
     "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCRwGE8OCQk/skzSse3837B4/PLCtW6FfYESiyFshpKlF8bOGl7MfpKXibbTfBdur0puNmGOPhSSPxzEsnHjmYp7xHErzgYVd/Wgqp9HdyQRBfqyVJXmSbhuhjFe7zCYyrp4gZY1maDa5T6p8nIj/acuXrmgJNLOeAcbW7RjS8EQIDAQAB" )  ; ----- DKIM key default for mydomain.com
nh4rtd9f  IN CNAME www.mydomain.com.


Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 17, 2018, 11:49:45 PM
Sorry I miss typed Its

Code: [Select]
service named restart
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 07:03:04 AM
Sorry there is a mistyped command above. Here is a correct one:

[root@vps196134 ~]# service named restart
Redirecting to /bin/systemctl restart named.service
Job for named.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.


Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 18, 2018, 09:41:33 AM
what is output of this.

systemctl status named.service
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 10:06:30 AM
Here it is:


[root@vps196134 ~]# systemctl status named.service
● named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-07-18 03:02:07 EDT; 3h 3min ago
  Process: 3650 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 13170 ExecReload=/bin/sh -c /usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
  Process: 12029 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 3660 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=1/FAILURE)
 Main PID: 12031 (code=exited, status=0/SUCCESS)

Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: zone ns2.baiagmumr5g.eu/IN: loaded serial 2013071600
Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: dns_rdata_fromtext: /var/named/baiagmumr5g.eu.db:2: near '20170922110026': out of range
Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: /var/named/baiagmumr5g.eu.db:36: file does not end with newline
Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: zone baiagmumr5g.eu/IN: loading from master file /var/named/baiagmumr5g.eu.db failed: out of range
Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: zone baiagmumr5g.eu/IN: not loaded due to errors.
Jul 18 03:02:07 vps196134.vps.ovh.ca bash[3660]: _default/baiagmumr5g.eu/IN: out of range
Jul 18 03:02:07 vps196134.vps.ovh.ca systemd[1]: named.service: control process exited, code=exited status=1
Jul 18 03:02:07 vps196134.vps.ovh.ca systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Jul 18 03:02:07 vps196134.vps.ovh.ca systemd[1]: Unit named.service entered failed state.
Jul 18 03:02:07 vps196134.vps.ovh.ca systemd[1]: named.service failed.



Thanks
Title: Re: Php errros in CWP panel
Post by: bullten on July 18, 2018, 11:00:35 AM
Issue in  /var/named/baiagmumr5g.eu.db

Recreate it.
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 11:22:08 AM
Here is the DNS record I have set in CWP panel:

$TTL    38400
@       IN      SOA     ns1.baiagmumr5g.eu.   admin.baiagmumr5g.eu. (
                        20170922110026 ; serial
                        90M ; refresh
                        15M ; retry
                        14D ; expire
                        3600 ; default_ttl
                        )
 
baiagmumr5g.eu.   14400   IN   NS   ns1.baiagmumr5g.eu.
baiagmumr5g.eu.   14400   IN   NS   ns2.baiagmumr5g.eu.
 
ns1   14400   IN   A   167.114.98.75
ns2   14400   IN   A   167.114.98.75
 
baiagmumr5g.eu.   14400   IN   A   167.114.98.75
 
localhost   14400   IN   A   127.0.0.1
 
baiagmumr5g.eu.   14400   IN   MX   0   baiagmumr5g.eu.
 
server   IN   A   167.114.98.75
www   IN   A   167.114.98.75
 
baiagmumr5g.eu.   IN   TXT   "v=spf1 a mx ptr a:baiagmumr5g.eu ip4:167.114.98.75 ?all"

_adsp._domainkey.baiagmumr5g.eu.   IN   TXT   "dkim=all"

_domainkey.baiagmumr5g.eu.   IN   TXT   "o=~; r=abuse@baiagmumr5g.eu"

_dmarc.baiagmumr5g.eu.   IN   TXT   "v=DMARC1; p=quarantine; sp=r; pct=100; aspf=r; adkim=s"


Can you please what is wrong with that?

Cheers
Title: Re: Php errros in CWP panel
Post by: studio4host on July 18, 2018, 12:57:28 PM
your serial is too long, it can be only 10 characters long
your is
20170922110026 ; serial
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 01:04:55 PM
thanks for your advice.

I have changed to the followings:


; Panel %version%
; Zone file for ns1.baiagmumr5g.eu
$TTL 14400
ns1.baiagmumr5g.eu.      86400      IN      SOA      ns1.baiagmumr5g.eu.      admin.baiagmumr5g.eu.      (
                  2013071600 ;serial, todays date+todays
                  86400 ;refresh, seconds
                  7200 ;retry, seconds
                  3600000 ;expire, seconds
                  86400 ;minimum, seconds
      )
 
baiagmumr5g.eu.   14400   IN   NS   ns1.baiagmumr5g.eu.
baiagmumr5g.eu.   14400   IN   NS   ns2.baiagmumr5g.eu.
 
ns1   14400   IN   A   167.114.98.75
ns2   14400   IN   A   167.114.98.75
 
baiagmumr5g.eu.   14400   IN   A   167.114.98.75
 
localhost   14400   IN   A   127.0.0.1
 
baiagmumr5g.eu.   14400   IN   MX   0   baiagmumr5g.eu.
 
server   IN   A   167.114.98.75
www   IN   A   167.114.98.75
 
baiagmumr5g.eu.   IN   TXT   "v=spf1 a mx ptr a:baiagmumr5g.eu ip4:167.114.98.75 ?all"

_adsp._domainkey.baiagmumr5g.eu.   IN   TXT   "dkim=all"

_domainkey.baiagmumr5g.eu.   IN   TXT   "o=~; r=abuse@baiagmumr5g.eu"

_dmarc.baiagmumr5g.eu.   IN   TXT   "v=DMARC1; p=quarantine; sp=r; pct=100; aspf=r; adkim=s"


But it still does not work.

Cheers
Title: Re: Php errros in CWP panel
Post by: bullten on July 18, 2018, 04:04:59 PM
did you try rebuilding zone?
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 05:20:15 PM
Hi,

Can you give me instruction on how to rebuild zone?

Cheers
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 18, 2018, 05:29:33 PM
Update: I have deleted a user I created in CWP panel to remove DNS record. And created it again to rebuild DNS records.

The issue is still the same; binding does not work.

Or I can give you SSH credentials to have a look? Do you have an email address?

Cheers
Title: Re: Php errros in CWP panel
Post by: studio4host on July 18, 2018, 10:40:46 PM
try to check info about the error

service named status

if the is no error info then you can check for bind error in the /var/log/messages file

example
Code: [Select]
service named restart
tail -n 200 /var/log/messages
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 19, 2018, 09:56:23 AM
Thanks, studio4host.

Bullen has fixed it. He may put his guides here soon to benefit everyone.

Cheers
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 19, 2018, 11:46:02 AM
Thanks.

What is the equivalent to:

service named restart

Title: Re: Php errros in CWP panel
Post by: jamshed_206 on July 20, 2018, 01:47:44 AM
Thanks.

What is the equivalent to:

service named restart

This service is used to restart the DNS service.
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 20, 2018, 08:04:46 AM
Thanks. I mean what is the equivalent to

service named restart   (that is for CentOs 6)

on CentOs 7?
Title: Re: Php errros in CWP panel
Post by: studio4host on July 20, 2018, 09:10:52 AM
you can use the same on the centos 7 or if you want you can also use systemctl on centos 7
systemctl restart named.service
Title: Re: Php errros in CWP panel
Post by: daro2013 on July 21, 2018, 06:12:02 PM
Thank you for all who have tried to help me especially Bullten. I found his advice on another link and was able to fix the issue with binding.

Just simply go to CWP panel --> DNS Functions --> Edit Nameservers IPs --> then press Save Changes to rebuild DNS records

Then in SSH, this command now works:

$ systemctl restart named


However, I have another issue. Because this ticket is too long, I will open another ticket.

Many thanks again for this great community.

Cheers
Daro
Title: Re: Php errros in CWP panel
Post by: faketoacc on August 14, 2018, 11:32:56 AM
Login to phpmyadmin with your root password.

Code: [Select]
http://serverip:2030/pma
Navigate to create database

Code: [Select]
http://serverip:2030/pma/server_databases.php
Create database.

Code: [Select]
oauthv2 as latin1_swedish_ci
Download the attached database and import in it.

Code: [Select]
http://send.bullten.net/download/3e2027b25812432019042b2d10b771a5.html
Hi Bullten,
Could you upload this database again, becaus I got that warnings and notices too.
Thanks alot.
Title: Re: Php errros in CWP panel
Post by: bullten on August 16, 2018, 06:17:48 PM
Here is the file https://send.bullten.network/download/384331592e4be3a0aadf84b2f9eb37fb.html
Title: Re: Php errros in CWP panel
Post by: buracat on August 17, 2018, 08:45:36 PM
I just installed the panel and i get the same error

(https://i44.servimg.com/u/f44/12/76/13/88/cwp-er10.png)
Title: Re: Php errros in CWP panel
Post by: sata on August 28, 2018, 04:45:31 PM
i have absolutely the same warning, upload please oauth2v database again, because link expired
Title: Re: Php errros in CWP panel
Post by: bullten on August 28, 2018, 04:56:31 PM
Someone upload it somewhere else as our system will delete it in 7 days

https://send.bullten.network/download/ef95faa2e951d34c129a1382f033c3eb.html
Title: Re: Php errros in CWP panel
Post by: sata on August 29, 2018, 05:01:15 AM
thanks, it fixed my problem
Title: Re: Php errros in CWP panel
Post by: josemnunez on August 29, 2018, 03:21:43 PM
You have tried to enter the User GUI
Title: Re: Php errros in CWP panel
Post by: xsilent on September 29, 2018, 09:33:03 AM
Someone upload it somewhere else as our system will delete it in 7 days

https://send.bullten.network/download/ef95faa2e951d34c129a1382f033c3eb.html

Can you reupload again, sure i will upload to my drive and give the link at here so it can be useful for other people who have same problems.
Title: Re: Php errros in CWP panel
Post by: bullten on September 29, 2018, 05:27:35 PM
https://send.bullten.network/download/ae08ab5e78a0137522d98e0df63a9d5d.html
Title: Re: Php errros in CWP panel
Post by: xsilent on October 03, 2018, 04:55:16 AM
https://send.bullten.network/download/ae08ab5e78a0137522d98e0df63a9d5d.html

I have been put this file into my gist on github,
at here >> https://gist.github.com/aalfiann/b628949373c40497b7904ce20651d3d2 (https://gist.github.com/aalfiann/b628949373c40497b7904ce20651d3d2)
Title: Re: Php errros in CWP panel
Post by: josemnunez on October 03, 2018, 09:00:10 AM
hmmm I see something wrong here, please do the following

- Backup your BD oauthv2
- Remove it
- Try to enter as a user

The DB must have been created, but not in InnoDB but in MyISAM

Please let me know how it went
Title: Re: Php errros in CWP panel
Post by: master.hesam on April 06, 2019, 05:36:53 AM
Hi I have this problem
I have the oauthv2 Database in my list

But my error is:

Warning: mysqli_connect(): (HY000/1049): Unknown database 'root' in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0

and in my cwp7 Dashboard: MySQL Database Server   is   failed
Title: Re: Php errros in CWP panel
Post by: neoart on April 06, 2019, 10:27:10 AM
Name servers is not ssetup good.
and for domain probably you didnt be directed corectly