473,467 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to execute a script in background using exec() from php script

13 New Member
Hi All,
I have to run a shell script from my php script and while shell script is running I have to do some other tasks in my php script.To run the shell script I am using
exec("sh myscript.sh &");
The Next line in my php script got executed after the shell script completes its execution. I want the next line of my script got eecuted as soon as i start shell script.
Please suggest me how can I run the shell script in background so that as soon as the shell script starts the exec command comes out.
Thanks
KSN
Jan 24 '08 #1
1 1964
code green
1,726 Recognized Expert Top Contributor
I think you need to use passthru() instead of exec()
Jan 25 '08 #2

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

Similar topics

8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
1
by: Miguel | last post by:
Hello, I'm trying to execute an Network command with PHP exec() function but i can't. The PHP script looks like the following: <?php ... exec('\\PTtype\Myapp'); ...
8
by: Bob Bedford | last post by:
I've a script that must "launch" an other script on some situations. firstscript.php: .... If ($newarticle) //launch secondscript.php .... The "secondscript.php" may take quite long, and is...
0
by: Dmitry Pljonkin | last post by:
Hi! I have some troubles trying to start php script using exec() and leave it running in the background. Manual says: "If you start a program using this function and want to leave it running...
5
by: Thomas | last post by:
I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to run a php-script as a separate process. This schript dies not have any output. I tried several variants without success: ...
5
by: Good Man | last post by:
Hi there I am trying to execute a custom-built java program on my linux server via PHP. Basically, a user uploads files via PHP, and then the java program performs some action on these files. ...
3
by: elrondrules | last post by:
Hi I am pretty new to PHP and hence need your help!! I need to write a PHP that shows the user a button (button1) and a series of check boxes and another button (button2).. If the button1...
4
by: Chr1s | last post by:
How do I execute a crontab command using php (not CLI) as user Joe? I don't have any problem getting output from commands such as 'ls' using passthru and exec but I am stumped with crontab. ...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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 ...

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.