473,387 Members | 1,624 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,387 software developers and data experts.

php ->sh ->php

Hi,

I'm trying the following without success:

I start a php script in the browser, that starts a shellscript, which
starts a second php script. As a result, I want to show the output of
the second php script in my browser. It works perfect on the shell
command line, but in the browser, the shellscript hangs!?!
I start the whole thing with the file file 'first.php':
first.php:
<?
$shell_output = shell_exec("/my_path/shellskript.sh");
?>
shellskript.sh:
#!/bin/bash
/usr/bin/php /my_path/second.php
second.php:
<?
echo "Hello World";
?>

Anyone with ideas, why this is not working?

regards,georg.
Oct 3 '06 #1
2 1985

Georg Weiler wrote:
Hi,

I'm trying the following without success:

I start a php script in the browser, that starts a shellscript, which
starts a second php script. As a result, I want to show the output of
the second php script in my browser. It works perfect on the shell
command line, but in the browser, the shellscript hangs!?!
I start the whole thing with the file file 'first.php':
first.php:
<?
$shell_output = shell_exec("/my_path/shellskript.sh");
?>
Maybe the shell_exe shellskript.sh should have certain environment
variables set?
>
shellskript.sh:
#!/bin/bash
/usr/bin/php /my_path/second.php
second.php:
<?
echo "Hello World";
?>

Anyone with ideas, why this is not working?

regards,georg.
Oct 3 '06 #2
On Tue, 03 Oct 2006 13:27:23 +0200, Georg Weiler <ge******@gmx.atwrote:
>I'm trying the following without success:

I start a php script in the browser, that starts a shellscript, which
starts a second php script. As a result, I want to show the output of
the second php script in my browser. It works perfect on the shell
command line, but in the browser, the shellscript hangs!?!
Hangs? Or just doesn't output anything?
>
I start the whole thing with the file file 'first.php':
first.php:
<?
$shell_output = shell_exec("/my_path/shellskript.sh");
?>
This script doesn't output anything - you'd need to print out the
$shell_output variable.
>shellskript.sh:
#!/bin/bash
/usr/bin/php /my_path/second.php
second.php:
<?
echo "Hello World";
?>

Anyone with ideas, why this is not working?

regards,georg.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Van Horn | last post by:
As a shell script, the following program works as expected. --------------------------------------- #! /usr/bin/sh echo '<html><? print 1 ?></html>' | php...
79
by: Tim Tyler | last post by:
PHP has some pretty funky error messages: "parse error, unexpected T_IF"; "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING"; Humans often see these - shouldn't they be more...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
0
by: heddy Boubaker | last post by:
hi, as the subject said I've pb compiling php-4.4.4 and php-5.1.6 with ldap module activated on linux debian sarge (2.6.8-3-686-smp) : - for 4.4.4 I've % /bin/sh /www/src/php-4.4.4/libtool...
0
by: Danny De Koster | last post by:
Hi all, I want to use PHP with our informix database. So I want to make PHP 'Informix-enabled' with Apache. I already made apache but now at PHP the system gives me problems. Does anybody...
2
by: hup | last post by:
One of my Linux (CentOS) server stop interpret php code any more. I did try to compile and installed other version of php, but it's still not working. # cat /tmp/phpinfo.php <? phpinfo() ?>...
1
by: Kesavan | last post by:
I install apache2 in /usr/local/apache2 and install php5 by ./configure --with-apxs2=/usr/local/apache2/bin/ apxs PHP is successfully installed in my system. But now my .php files inside...
4
by: IDK | last post by:
I have the following code: <? #!/usr/bin/php-cgi -e $dbconn = pg_pconnect("host=localhost dbname=zerus ". "user=zuser password=1") or die('Could not connect: ' . pg_last_error()); ...
4
by: eros | last post by:
During development (debugging) the site works well but when I release from the debugging and test into production.. the result from PHP file was not displayed. test.php <a...
2
by: DragSta | last post by:
Hello everyone, im slowly learning PHP and im strarting to kinda get the hang of the basics. Basically, i am making a control panel for a Game Server, that can start and stop the server by running...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.