View previous topic :: View next topic |
Author |
Message |
curan -
Joined: 12 May 2004 Posts: 3
|
Posted: Tue Jun 01, 2004 11:55 pm Post subject: A shell_exec example for windows anyone? |
|
|
I am trying to incorporate spell checking into my html forms. To do this I have installed aspell(0.50.3) (http://aspell.net) on my server, I have tested it from the command line and it works. I have installed php(4.3.6) and I have configured the web server to work with it and it works as well. I am using some sample pages written in JavaScript and php ‘spellerpages’ (http://spellerpages.sourceforge.net/) to see how the spell checking works. I’ve traced the execution of the code and everything works up to the line of code in the file spellchecker.php
if($aspellret = shell_exec($cmd)) {….
php is NOT in safe mode, I have ‘YES’ selected in ‘SSI Parameters’ , ‘Exec cmd Execution’. I’ve played with the $cmd string, I’ve hard coded it, but to no avail. I've tried making my own test script using shell_exec but they don't work which may simply be because this is my first try at using php.
Does anyone have any simple suggestion on how I could test that the shell_exec command was working? Or is there some other server setup parameter I am missing? I’m running windows 98. Thanks for you help.
New to PHP
Curan |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Jun 02, 2004 11:43 am Post subject: Re: A shell_exec example for windows anyone? |
|
|
curan,
shell_exec() is a PHP command so it has no relation with the SSI settings. It seems that there is a problem preventing this shell command from being executed. Please send us your php.ini file to support@aprelium.com . _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
curan -
Joined: 12 May 2004 Posts: 3
|
Posted: Wed Jun 02, 2004 11:43 pm Post subject: Re: A shell_exec example for windows anyone? |
|
|
Update:
I created a command line 'exe' that printed out "Hello World" and was able to get it to run in a php script, using shell_exec, which then generated an html page. So it looks like the shell_exec works fine and my problem must be in the command I am trying to send to it.
I'm asuming that the php.ini file is ok.
Would you agree with that logic?
The next thing I will test is having my 'exe' read a file to generate its output. This is what the actual aspell exe does. |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Jun 04, 2004 11:02 am Post subject: Re: A shell_exec example for windows anyone? |
|
|
[quote="curan"]Would you agree with that logic?[quote]
Yes. One more thing. When sending the command to shell_exec, use its full path name. Otherwise, if the executable is not in your system PATH, it won't be found by the shell. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
curan -
Joined: 12 May 2004 Posts: 3
|
Posted: Fri Jun 04, 2004 11:44 pm Post subject: Re: A shell_exec example for windows anyone? |
|
|
Update
I have 'speller pages' working.
I put aspell.exe in my path so I would not have to code in the full path.
In the file spellchecker.php;
I put my temp file in 'c:' to limit the use of '\'.
I dropped '2>&1' from the end of my command statement.
I added 'aspell_err = "";' I might have deleted it by mistake earlier.
Thanks for the help, it was good to be able to bounce ideas around.
Now to learn about escape codes.
curan out. |
|
Back to top |
|
 |
|