473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

running perl in php

44
hi everyone

i am running ubuntu and all my scripts are in php,i have a program
written in C and Perl that do a specic job in my site.so my problem is i can't run that specific program while i am out site the directory.

can someone help me with a php code that can run the program that is out site the current working directory.i use the following code but nothing happend.

$output=exec(/home/data/test make.pl )
shell_exec("cd /home/data/test make.pl ");

make.pl is the script that i want to run.
May 8 '08 #1
3 1523
gnawz
64
hi everyone

i am running ubuntu and all my scripts are in php,i have a program
written in C and Perl that do a specic job in my site.so my problem is i can't run that specific program while i am out site the directory.

can someone help me with a php code that can run the program that is out site the current working directory.i use the following code but nothing happend.

$output=exec(/home/data/test make.pl )
shell_exec("cd /home/data/test make.pl ");

make.pl is the script that i want to run.
Why do you run the program outside the directory?It is just a series of code and I bet you want all your code to be executed!
Put it in the same directory and then run a shell script.
May 10 '08 #2
dlite922
1,584 Expert 1GB
hi everyone

i am running ubuntu and all my scripts are in php,i have a program
written in C and Perl that do a specic job in my site.so my problem is i can't run that specific program while i am out site the directory.

can someone help me with a php code that can run the program that is out site the current working directory.i use the following code but nothing happend.

$output=exec(/home/data/test make.pl )
shell_exec("cd /home/data/test make.pl ");

make.pl is the script that i want to run.
shell_exec() should work.

Yours doesn't because, CD is a command and MAKE is a command.

did you try this

shell_exec("/home/data/test/make.pl");
May 10 '08 #3
realin
254 100+
i bet shell_exec() should solve the purpose
cheers !!
May 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this...
7
by: AznCollegeGuy | last post by:
Hello, Im trying to invoke a simple perl script with in my visual c++ gui program to with c++'s system call feature: when i call: system("dir"); it works
10
by: shumaker | last post by:
I don't need a detailed description of a solution(although I wouldn't mind), but I am hoping someone could tell me in general the best path to go about accomplishing a task, since I don't know all...
0
by: Titof | last post by:
Hello, i want to create an active webpage that displays the status of users quotas on a volume of a server. I installed IIS on this server and installed Win2k server Resource Kit because the...
3
by: sir.linying | last post by:
My php script is to call perl scipt which makes use of Spreadsheet::ParseExcel module to parse Excel file. I am able to launch php script from command line so that perl script can run and properly...
4
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml'...
2
by: carllucas | last post by:
I have no exprience with perl. What I'm trying to do is have a script/program constantly (perpetually) running on my server so that it performs a routine (like every hour) and automatic check of...
1
shrek123
by: shrek123 | last post by:
Hi, I have to call a perl program(if it is not running) from a perl program How can I check if my program is already running or not. I somehow, didn't like the idea of using some file as tag....
1
by: Tension | last post by:
Hi. I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script...
6
by: aravindtn | last post by:
i have a netwok,and i have a perl script running on a machine(say machine1). the purpose of the script is to login to each of the other machines using ssh. i am able to logon to other machne (say...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.