How to run perl script with a few arguments from php
Posted
by Cristalla
on Stack Overflow
See other posts from Stack Overflow
or by Cristalla
Published on 2010-05-25T20:28:12Z
Indexed on
2010/05/25
20:31 UTC
Read the original article
Hit count: 208
My html webpage calls php script to upload files to the server from a local computer as follows.
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p><b><h3> <font color="#003366"> (1) Upload your reading text file. </font>
</h3> </b> </p>
<INPUT type="file" name="uploaded" size="50" >
<br/>
<input type="submit" name="files" value="upload">
</form>
In order to process with an uploaded file, my php script calls shell script
$output=system('/bin/sh connector_0.sh');
and my shell script is composed of a series of python/perl scripts.
#!/bin/sh
python main_senselearner_final_0.py
senseLearner.pl -i Uploaded_Files/slinput_0.txt -o Uploaded_Files/presloutput_0
.txt -model modelNNCollocations -model modelJJCollocations -model modelVBColloc
ations -pos
python smutngslout_0.py
python genhtml_0.py
Now, the problem is the following: all python scripts in shell script worked fine through php. But perl script didn't work.
When I run shell script by myself in my server, all four scripts in shell worked perfectly. However, when I run shell script from php, only perl script doesn't work.
Would you please give me any tips to solve this problem?
Many thanks!!!
© Stack Overflow or respective owner