Jump to content

problem running program with exec()?


shams

Recommended Posts

I want to run the getmail  from php  code, this is the php code but it is not running the getmail:

<?php
chdir('/home/user/.getmail');
exec('./getmail.sh');
?>

getmail.sh and gmail-file are inside the '/home/user/.getmail' directory, i also tried the shell_exec() but not run the program, this is the getmail.sh code:

#!/bin/sh
/usr/bin/getmail --rcfile gmail-file

 

Link to comment
Share on other sites

Thanks for reply i test the code it runs the bash scripts,  i created test.sh file with the content "this is a test file", and run with the code:

<?php
system('/home/user/tmp/test.sh');
?>

The code  printed the file to the browser successfully, but cannot start the linux applications like getmail and i tested for the filezilla with the code:

<?php
sysetm('/usr/bin/filezilla');
?>

  how to start the getmail with php?

Link to comment
Share on other sites

This is the code i am trying to start the getmail from the php code in the ubuntu 18.04,  getmail.sh cat start the getmail from the gnome terminal but from php  code  bellow it cannot start the getmail:

<?php
system('/home/user/.getmail/getmail.sh);
?>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.