Page 1 of 1
Batch file aborts after calling PHP
Posted: Sat Mar 24, 2007 7:10 pm
by Ambush Commander
I have attempted to create a batch file like this:
Code: Select all
php package.php
cd library
rm *.tgz
pear package
However, the batch file always seems to abort after the first line, `php package.php`.
There is a file php.bat in my path that looks like this:
Code: Select all
"C:\php\5.2.0\php.exe" -c "c:\php\ini_dir\cli" %*
Hopefully not the problem.
Posted: Sun Mar 25, 2007 8:47 am
by aaronhall
Did you need to cd to the 'library' directory before calling package.php?
Posted: Sun Mar 25, 2007 1:14 pm
by Ambush Commander
Yeah, otherwise pear complains. It shouldn't be a problem, since I've tried getting rid of everything else and putting an echo Foo! right after the PHP call.
I've also tried explicitly exit(0) and exit(1) in the PHP file.
Posted: Sun Mar 25, 2007 1:20 pm
by aaronhall
The only things I can think of are checking your log files and just making sure that you are in the same directory that package.php is in before you call the batch file. Also, I assume you are able to call package.php yourself and get back to the command line without error?
Posted: Sun Mar 25, 2007 1:25 pm
by Ambush Commander
The only things I can think of are checking your log files
Erm... what logs? This is command line, after all.
you are in the same directory that package.php is in before you call the batch file
Yep, definitely I am. Otherwise, `php package.php` wouldn't work, and it does work.
Also, I assume you are able to call package.php yourself and get back to the command line without error?
Yes.