Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command line script not running properly

Status
Not open for further replies.

superjett

MIS
Jun 18, 2004
62
US
I am running some .php pages from command line under Win2003 and having trouble with one that accesses a local file.

I have one that will send an e-mail just fine, but another in the same directory that imports data from a .txt in the same directory says the file doesn't exist when it in fact does.

Are they any considerations with file operations when running from a command line? Both work fine in a browser.

This works
Code:
c:\php\php.exe c:\internal\test\mail.php

This doesn't
Code:
c:\php\php.exe c:\internal\test\import.php
 
The only pertinent consideration I can think of is permissions. When run via a web browser, a PHP script uses the permissions of the user as which the web server runs. When run from a command-line, the script runs as the user who invokes the script.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
That's a good point. I was logged in as administrator while testing, so that shouldn't be an issue but I'll double check.
 
Sometimes you just need to sleep, I was calling the wrong php.exe, not the one that Apache is using.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top