you probably have to give user nobody.nobody permissions to the files you're backing up

i have given all permissions because i have used
chmod 0777 file/folder name

can i do soemthing like login as root from php script and untar the file. if yes, what commands i have to use for logging in as root from php

not so sure, try to chown, not just chmod.
and as for root under php... try sudo?

will the command be something like

exec("sudo -u root /usr/trial/x.tar")

just read man sudo (look for silent execution, no passwords asked) and add nobody to sudoers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.