My environment is php5.3+apache+windows xp+bsdtar.exe(renamed to tar.exe) in my system path
I have this code in my extract.php:
shell_exec(‘tar –no-same-permissions -xjf “C:\Documents and Settings\abcxyz.tar.bz2″‘);
I can run extract.php using php client in cmdline, like:
php extract.php
But whenever I try to run on the local server, the tar is not executed. My php and apache path both have tar.exe folder included.
not sure why it’s not working?
if you run directly from php, you will run that command on behalf of your user, Apache instead is another account witch doesn’t have privileges.
Execute services.msc and find the apache service, right button > Log On tab and change from Local System Account to a user created account, enter the username and the password and restart the service.