PDA

View Full Version : Problem with PHP execution


r3flux
03-25-2005, 10:35 AM
heya ioftpd forum!

i want to call a php script through a site command.

my ioFTPD.ini looks like:

[FTP_Custom_Commands]
mycommand = EXEC php.exe -q s:\htdocs\jobs\command.php

[FTP_SITE_Permissions]
mycommand = 1M


content from command.php

<?php echo "test 1 2 3"; ?> (just for testing ;) )

when i now perform this command in on the ftp, i'll only get this return message:


[R] site mycommand
[R] 200 Command successful.
but no response from the script ...

any idea what i've done wrong?

thx for help!

Mouton
03-25-2005, 02:53 PM
php.exe not found.
where is it ?

r3flux
03-25-2005, 05:07 PM
Originally posted by Mouton
php.exe not found.
where is it ?

hm, when i run this script manually in the windows shell, it works great.

even when i enter the full path to the php.exe in ioFTPD.ini, it wont work (full path to php.exe: D:\ioFTPD\system\php.exe).

SnypeTEST
03-25-2005, 05:41 PM
try making a .bat file

@echo off
echo hello balls!
php.exe -q myphp.php

and execute the bat file instead..

r3flux
03-26-2005, 07:25 AM
Originally posted by SnypeTEST
try making a .bat file that wont work either.

i cant find the error why this wont work.

first of all, my current folder structure:


d:\ioFTPD\system\php.exe
d:\ioFTPD\scripts\dupecheck\nuke.bat
d:\ioFTPD\scripts\dupecheck\nuke.phpcontent from nuke.bat


@echo off
echo hello balls!
D:\ioFTPD\system\php.exe -f D:\ioFTPD\scripts\dupecheck\nuke.php
content from ioFTPD.ini


[FTP_Custom_Commands]
nukeBat = EXEC ..\scripts\dupecheck\nuke.bat
nukePHP = EXEC D:\ioFTPD\system\php.exe -q -f D:\ioFTPD\scripts\dupecheck\nuke.php

[FTP_SITE_Permissions]
nukeBat = 1M
nukePHP = 1M
content from php doesnt changed (see my first post).

results:


[R] site config rehash
[R] 200 config Command successful.
[R] site nukePHP
[R] 200 Command successful.

[R] site config rehash
[R] 200 config Command successful.
[R] site nukeBat
[R] 200-hello balls!
[R] 200 Command successful.
but the php wont be executed.

:confused:

when i copy&paste the execute line (nukePHP) from ioFTPD.ini to windows shell it works perfect. so the problem is not the php.exe.

i dont know what i must do now, i spend now 1 hour finding the error at this strange problem.

SnypeTEST
03-26-2005, 12:36 PM
try putting a \n at the end of your print statement.

<? print "1 2 3\n"; ?>

also, try this bat file..

@echo off
echo executing php
D:\ioFTPD\system\php.exe -f D:\ioFTPD\scripts\dupecheck\nuke.php
echo Finished

r3flux
03-26-2005, 06:48 PM
Originally posted by SnypeTEST
try putting a \n at the end of your print statement.

<? print "1 2 3\n"; ?>


weeee!!!! it works! :banana:

thanks for helping me out man, really appreciated :)