Refer the following steps:-
Create / open a new PHP File
1) new site
2) Yes I want to use server technology
3) which server technology: PHP MySQL
4) I chose to edit directly on FTP server using FTP
5) enter in your FTP details
ftp.domain.com
folder you want to access = public_html
login = cpanel username
password = cpanel password
6) test the connection
7) insert your domain url
“https://www.domainname.com“
8)you can enable the check in /out if you wish.
9)window>database> click the + and select MySQL connection
10) server details: The one you provided
connection name = whatever you wish
MySQL Server = localhost
username = cpanelusername_username
password = xxxx
database = cpanelusername_databasename
then hit test and it connected successfully.