Batch file aborts after calling PHP

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Batch file aborts after calling PHP

Post 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.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Did you need to cd to the 'library' directory before calling package.php?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
Post Reply