Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to execute swetest.exe on shared hosting? #4

Open
vvsshukla opened this issue Oct 27, 2018 · 3 comments
Open

How to execute swetest.exe on shared hosting? #4

vvsshukla opened this issue Oct 27, 2018 · 3 comments

Comments

@vvsshukla
Copy link

Is there any way to make exec function work on shared hosting as i got to know that exec function does not work on shared hosting.

@safinazxyz
Copy link

safinazxyz commented Apr 21, 2021

Is there any way to make exec function work on shared hosting as i got to know that exec function does not work on shared hosting.

$sweph= public_path().'/sweph'; // .se1 files directory
$exeFilePath=public_path().'/swetest'; // executable file - don't forget to enable execute permission for the file
exec("$exeFilePath -edir$sweph -b$utday -ut$utdateTime -p0123456789 -eswe -house$longitude,$latitude,$h_sys -flsj -g, -head", $out);

@meggistorvard
Copy link

meggistorvard commented Nov 23, 2021

here my solution

$docroot = $_SERVER['DOCUMENT_ROOT'] . "/somedir";
if (strtoupper(substr(PHP_OS,0,3)) === 'WIN') { $fullpath = $docroot . "/swetest.exe"; $swephsrc = $docroot . '/sweph'; $sweph = $docroot . '/sweph'; } else { $fullpath = "/home/someuser/bin/swetest"; $swephsrc = '/home/someuser/bin'; $sweph = '/home/someuser/bin/sweph'; }
exec ("$fullpath -edir$sweph -bj$ejd -p$p_idx -eswe -fls -g, -head", $out);

Make sure the swetest file and ephemeris files in sweph folder are present.
Bye

@tomherold
Copy link

tomherold commented Sep 5, 2022

Does this also work for a UNIX server? I can't make it work, even with the right path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants