cPanel Terminal opens a shell for the hosting account when shell access and the feature are enabled. Begin with read-only checks so you understand the account and directory before running commands that change a live website.
IN THIS ARTICLE
What you need before you begin
Open the correct service and identify the task. Keep credentials and private file contents out of copied logs. A shared-hosting shell has account-level permissions and should not be treated as a root server console.
01 Use cPanel Terminal for a read-only first diagnosis
- Open Terminal in cPanel and read its warning. Confirm you are working under the expected account.
- Run
pwdto see the current directory andidto identify the current user. These checks prevent confusing the account home with a website root. - Use
ls -laonly in the relevant directory to inspect filenames and permissions. Avoid pasting a full home-directory listing into a public forum. - For a PHP-related task, inspect the application’s documented runtime and use
php -vonly to identify the command-line default; it may differ from web PHP. - When finished, end the session with
exit. Save a short note of findings and the next specific change needed.
02 Example: establish account identity and location without changing files
After opening cPanel Terminal for the correct hosting service, run this small account-level inventory. It helps establish where you are before troubleshooting. None of the commands below edits files, changes permissions or needs root privileges.
pwd
id
ls -ld . public_html
php -v
Read the result: pwd identifies the current directory and id identifies the account. The directory listing checks whether a public_html entry exists relative to that location. A missing entry can simply mean you are in another folder, and additional domains may use different document roots. php -v reports only the default CLI runtime.
Use the panel's domain configuration to identify the exact website root before going further. Keep credential files closed and share only the minimum relevant output with support. This baseline is useful evidence, but it does not yet diagnose a failed page or prove that web PHP matches the command line.
Confirm the expected result
You should know the account identity, current path and relevant file location without modifying data. Reproduce an application error through its normal interface before searching the matching logs.
Troubleshoot unexpected results
If Terminal is missing, the plan or permissions may not include shell access. Do not install a public web-shell script as a workaround. Ask support for an approved diagnostic route.
Are commands copied from a guide safe to paste?
Read them first and replace placeholders carefully. Commands that delete files, overwrite configuration, download and execute scripts or modify databases require a verified path and backup. A familiar-looking prompt does not make an unknown command harmless.