PDA

View Full Version : php doesn't terminate


anjo
12-29-2003, 03:07 PM
hey!

I've written a script in php. When I call the script in windows from dos (php.exe -q -n c:/blabla/bla.php) it runs as it should and then terminates.

But when I call the same script from ioftpd (phptest = EXEC c:/blabla/php.exe c:/blabla/bla.php under [scripts] in ioftpd.ini) with 'site phptest' the script runs but never terminates! Even when I tell it to terminate with both die() and exit()!

In the ftpclient no result is presented untill I manually kill php.exe through taskmanager.

Any suggestions would be appreciated!

ioftpd v5.3.0

ADDiCT
12-29-2003, 03:25 PM
why don't u supply the parameters -q -n in your sitecommand ? i don't know what they do, but:
- u use them in your console box, and not in ioftpd
- when running it in your console box it closes, and in ioftpd it doesn't

and please upgrade your ioFTPD to latest 5.3.9 version (or 5.4.3)

anjo
12-29-2003, 04:52 PM
I actually do supply the -q -n parameters in site command.. I only forgot to write them when I posted..

.. I upgraded to 5.3.9 and there was no change.. I'll try upgrading php to latest version(5.x beta ?) tomorrow

... okey I couldn't wait for morning so I upgraded php to latest beta (5.0.0b3) and it seems to have solved the problem..

btw
look at http://aspn.activestate.com/ASPN/docs/PHP/commandline.html
if you want to know what -q and -n does

SnypeTEST
12-30-2003, 10:35 AM
use php.exe from \cli\ folder of your php distribution.

anjo
12-30-2003, 05:50 PM
cli = command line interface?`
heh ok thanks..

since you're using php in your script maybe you know the answer to another question of mine?

I have a very simple ftp login script that works in windows dos.
I change nothing and run it from ioftpd and it fails to login!!?!!

SnypeTEST
12-30-2003, 06:01 PM
you need systemroot and windir in the environment

MaZza_Dj
01-08-2004, 05:41 AM
Excuse me but i have used this php.exe donwloaded from http://members.lycos.co.uk/snypetest/ don't go have pho.exe php.ini and 3 files *.dll
this php don't terminate my cpu work 100% all time....this are one big problem but the sfv check go with this php i can't use this!!!

in alternative i have used only php.exe and php4ts.dll from php-5.0.0b3-Win32 downloaded from www.php.net...with the old version of ioFTPD go and go very good perfect cpu usage and perfect sfvcheck with ioFTPD 5.4.3 tell me this error

[23.21.54] 226-<b>Fatal error</b>: Maximum execution time of 30 seconds exceeded in <b>E:\ioFTPD\scripts\php_psio\funcs.php</b> on line <b>1256</b><br />
[23.21.54] 226 Transfer complete.

I CANT USE THIS with this version of ioFTPD or the last version of php_psio i don't know what is it!!!

Now i try php.exe from cli folder in php-5.0.0b3-Win32 and all file from SnypeTEST php packet download from http://members.lycos.co.uk/snypetest/: DON'T GO THE SFV CHECK with this config and all file uploaded was deleted in automatic!!!

The last alternative is php.exe from cli folder and php4ts.dll from php-5.0.0b3-Win32 downloaded from www.php.net AND WITH THIS CONFIG I HAVE THE SAME PROBLEM WITH THE ORIGINAL PACKET DOWNLOAD FROM http://members.lycos.co.uk/snypetest/
DON'T CLOSE IT THE PHP.EXE

darkone
01-08-2004, 06:22 AM
As already suggested it's likely that some environment variable is missing.

anjo
01-09-2004, 05:36 AM
With the cli (php v4.3.4) and the windir/systemdir in enivronment everything seems to be working as it should.

How to add windir and systemdir to environment, iotrial:
"
$windir="c:\\windows\\";
putenv("WINDIR=".$windir);
putenv("SYSTEMROOT=".$windir);
"

Mouton
01-09-2004, 11:40 AM
adding those variables in ioftpd.env would be a better solution...

SYSTEMROOT=%[environment(SYSTEMROOT)]
WINDIR=%[environment(SYSTEMROOT)]

Both have the same value btw... thus where (SYSTEMROOT) in both...