FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php exec ( ) DO NOT work for relative paths: Help?
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
php exec ( ) DO NOT work for relative paths: Help? [message #182763] Fri, 06 September 2013 02:58
Fastian is currently offline  Fastian
Messages: 20
Registered: June 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I am trying to execute a batch file using exec(). I am on Windows using xampp.
The exec() works well when the php file and batch file are in the same directory but it do not work if the batch file is present in another folder and you have to specify the path.

I have tried using relative as well as absolute paths but nothing has worked so far. For example my php file is in folder1 and batch file is in folder2 so I tried in following ways: (folder2 is present inside folder1)

exec('folder2\abcFile.bat');
exec('C:\xampp\htdocs\folder1\folder2\abcFile.bat');
exec('C:\\xampp\\htdocs\\folder1\\folder2\\abcFile.bat');

Also tried realpath() but it also didn't help.
Please reply if you have experience handling this issue.
Thanks!
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Strange url session behaviour after upgrade to 4.3
Next Topic: Apache + php + directory browsing + reader for TXT files
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Dec 15 07:23:23 EST 2017

Total time taken to generate the page: 0.00606 seconds