PHP - Executing an external program - TechRepublic
General discussion
April 15, 2002 at 12:41 AM
mlester

PHP – Executing an external program

by mlester . Updated 24 years, 2 months ago

Hello,
I’m somewhat new to using PHP in a UNIX
environment. I’m having trouble
running the ispell executable from within PHP.

From the shell, my command runs fine. Even
when I use the sudo command to
simulate the webserver’s user.

My command is:

ispell -a -f /tmp/outfile < /tmp/infile infile contains the text to be checked. When I issue this command in the shell, outfile is filled with the results of my checking. However, when PHP executes it, the outfile is generated but it's blank. I changed my command to this: ispell -a -f /tmp/outfile < /tmp/infile &>
/tmp/error

when php executes this command, outfile is
created, outfile is empty, and
when I look at /tmp/error it says:

zsh: permission denied: ispell

Does anyone know what I’m doing wrong?

Thanks in advance,

-Mike

This discussion is locked

All Comments