Help - Search - Members - Calendar
Full Version: PHP exec() question
The Planet Forums > Control Panels > Plesk
Taki
I am trying to execute a php script in a PSA5 virtual host.
safe mode is off so this shouldn't be a problem. However I am not able to execute with exec(), system() or passthru(). The same php works without problems in other systems.
What I am doing is generating static html pages from the output of the php page.
I would appreciate any suggestions if this is related to PSA configuration as I am stuck with this.

TIA
Taki
No one had this problem?
If some of you have it working could you please give me an example?

Thanks
4PSA
What does the function return?
Taki
QUOTE
Originally posted by 4PSA
What does the function return?


Nothing. It's like it's not allowed to use this command.
I run
exec("/usr/bin/lynx -source http://www.domain.com/page.php");

I tried with passthru, system, exec and `backtick` and the result is the same. I think I have to see if I could do it by using curl but I haven't checked yet.
4PSA
Check to see if you can execute a simple scipt located in the same directory with the calling php script.
Taki
QUOTE
Originally posted by 4PSA
Check to see if you can execute a simple scipt located in the same directory with the calling php script.


I have already tried to put the command in a shell script and from php execute the shell script (in the same directory):

exec("sh shellscript.sh");

same result:-( When running from the command line it works properly.
Taki
Happily I did it by using curl:-)

However it seems system functions cannot be executed from a php page.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.