LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-06-2008, 01:43 AM   #1
raven
Member
 
Registered: Dec 2001
Location: Basel, Switzerland
Distribution: ubuntu
Posts: 297

Rep: Reputation: 30
Executing shell script with shell_exec from PHP5 on Apache2 gives timeout


Hello

I have a small shell script like this:

Code:
#/bin/bash

echo "Start."

# execute some binaries
# write some files
# echo some more

echo "Done."
exit 0
Which is called in a .php file like this:

Code:
$debug=shell_exec($pathTo/$shellScript.' -s '.$params);
The script generates output as expected, the results of the script (wrinting some file) are correct, running the script from shell gives me what I expect it to do.

Then why do I get this (as output from the php file):

Fatal error: Maximum execution time of 30 seconds exceeded in /path/to/php_file.php on line #lunenumber

BTW: the script terminates faaaaar less than 30 secs. Normal execution time from shell is like 2 secs...

Any suggestions?

Thanks

raven
 
Old 02-06-2008, 02:04 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
yes - check your /etc/php5/cli/php.ini ... depending on your distribution this could be located somewhere else!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
executing konsole from shell script Meriadoc Linux - Newbie 10 07-10-2009 08:08 AM
Executing a command in Shell Script gjagadish Programming 7 10-15-2007 04:23 AM
Executing a shell script command!! vishamr2000 Programming 4 08-15-2005 12:33 AM
executing shell script on apache nooodles Linux - General 1 06-29-2004 01:51 AM
executing a shell script from C llama_meme Programming 2 04-01-2002 09:10 PM


All times are GMT -5. The time now is 01:09 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration