473,663 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

running perl in php

44 New Member
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 1533
gnawz
64 New Member
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 Recognized Expert Top Contributor
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 Contributor
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
10517
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 program is already running, please try again in a couple of minutes). For doing this, I guess I have to check the running processes... but I don't know how to do that and how I can identify my program in the running processes.
7
4430
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
2555
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 the capabilities of what I have available. I can learn the details myself I think. I am trying to set this up to be as simple to use as possible since others will be importing data on a weekly or daily basis. I need to import some text files,...
0
3698
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 Perl script "DiskQuotas.pl" exactly doing what i want. I created a function (see below) that running the script in a dos-command mode... BUT nothing happens :(( please help me
3
4123
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 parse Excel file. However, when I put php script on server side and then launch php through client request, perl program can't run. Anyone has any suggestion re how to fix this problem? Thanks a lot, -Ying
4
3750
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' method='get'> <!--#exec cgi="/cgi-bin/docsearch.pl--> </form> This correctly ran the script, but it was unable to include the
2
2122
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 something like the current weather in Tokyo and records it. The catch is that I want this to be done back-end and automatically without someone having to go onto the website and doing a "check" or something. This would mean that the script must be...
1
1557
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. My platform could be a MAC OS or windows. Please throw some light on how can I do it.
1
2313
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 supplied by the build system vendor. My first idea was to write a .bat scrpt that first calls the buildEnv.bat script and then calls the perl script. This does not seem to work since the perl script never executes. The .bat file looks like this: ...
6
3216
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 machine2) byusing the following code system("ssh <host_ip>"); after loging on to the network i need to run another perl script that is saved on the machine2. i want it to be done from the perl script running on machine1. i tried to do it by...
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.