Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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


I have a small shell script like this:


echo "Start."

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

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

$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?


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

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


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:18 AM.

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