Hi forum ,
I trying to execute commands using php. for example using the following code i am renaming a file
echo exec("ren cfile.php cfile.txt");
while i try to execute this code in my windows server it doesn't work , i test the same code in my localhost (local machine) its working fine and able to rename the file.
when i try with another command like " echo exec("tasklist"); " it working as like in the localsystem .
So please suggest me why i am unable to rename on my windows server.
thanking you in advance
Unable to execute some windows commands
Moderator: General Moderators
-
thecodewall
- Forum Commoner
- Posts: 33
- Joined: Sun Dec 26, 2010 8:37 am
Re: Unable to execute some windows commands
Php is a server side language, all processes includes making and modifying files are done in sever side.
You mention that its actually running in localhost, localhost is the server machine, its suppose to work in your windows server. I think you check the permission, if you allow to modify files
You mention that its actually running in localhost, localhost is the server machine, its suppose to work in your windows server. I think you check the permission, if you allow to modify files
Last edited by thecodewall on Tue Jan 04, 2011 11:24 pm, edited 1 time in total.
Re: Unable to execute some windows commands
if you uploaded to an account with a shared host, some php functions may be disabled for security reasons. Check your phpinfo() for 'disable_functions' in the 'Configutation PHP Core' section. to make sure.v2kish wrote:Hi forum ,
I trying to execute commands using php. for example using the following code i am renaming a file
echo exec("ren cfile.php cfile.txt");
while i try to execute this code in my windows server it doesn't work , i test the same code in my localhost (local machine) its working fine and able to rename the file.
when i try with another command like " echo exec("tasklist"); " it working as like in the localsystem .
So please suggest me why i am unable to rename on my windows server.
thanking you in advance