www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problem with Batch called by PHP

  1. #1
    Join Date
    Nov 2009
    Location
    Berlin
    Posts
    9

    Problem with Batch called by PHP

    Hello,
    as said in the title I wrote a batch file that is called by a php script using

    PHP Code:
    pclose(popen('download.bat -o dl_videos\\'.$videoId.'\\'.$videoId.'.flv "http://www.youtube.com/watch?v='.$videoId.'" C:\\wamp\www\\VideoTOCcer\\youtube\\webpage\\dl_videos\\'.$videoId.'\\'.$videoId.'.flv.dlfin''w')); 
    The batch file executes a python script (..once again..) and looks like this:

    Code:
    start c:\Python26\python.exe
    c:\wamp\www\python\youtube-dl.py %1 %2 %3
    mkdir %4
    this doesn't seem to work, I can see python.exe running in the taskmanager but nothing else happens - a download of a youtube video should be triggered, after finishing the download I want a folder created telling another script the download has finished.

    using echo I check what php gives to the batch as variables, if I paste that quote in to the cmd pompt everything works as it should. I'm a bit confused. I set rights on the python script for IUSR and calling it directly via pclose(popen()) everything worked fine.

    Thanks for any hint

    regards

  2. #2
    Join Date
    Nov 2009
    Location
    Berlin
    Posts
    9
    Argh!
    I found the mistake:
    Code:
    start c:\Python26\python.exe c:\wamp\www\python\youtube-dl.py %1 %2 %3
    mkdir %4
    line 1 and 2 have to be on one line....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles