/    Sign up×
Community /Pin to ProfileBookmark

PHP-win and exec()

Hi

I have associated .phpw with php-win.exe on my windows pc. I create a small test-script with this:

[code=php]
$program = “ping 127.0.0.1”;
$program2 = “D:\myfolder\myprogram”;

exec($program,$return_array);
exec($program2,$return_array2);
[/code]

When running this from a browser or command line php, everything works ok (the return arrays are filled with expected info). But if I launch the phpw-file only the first exec (ping) works. The return array of the second exec is empty. “myprogram” is just a small dos-program which does some stuff.

The strange thing is that myprogram seems to do “something” because if I add switches to it which cause it to take longer time, the launch of the .phpw will take longer. But it’s not doing anything, since some switches should cause it to create a file on disk. I even tried to chdir(myfolder), without any success.

So, exec of myprogram works from web and php command line, but not when launching with php-win. Any ideas/advice?

Thanks
Lubox

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Lubox spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...