Page 3 of 3

Re: mod_harbour for non dedicated servers

PostPosted: Wed Jan 12, 2022 1:08 pm
by Enrico Maria Giordano
My web space is on a Windows server.

EMG

Re: mod_harbour for non dedicated servers

PostPosted: Wed Jan 12, 2022 1:16 pm
by Antonio Linares
Here you have it:

https://github.com/FiveTechSoft/mod_harbour/tree/master/cgi/windows

You need the EXE and the DLL and you may use test.prg for a test:

test.php
Code: Select all  Expand view
<?php
   print( shell_exec( "modharbour.exe test.prg" ) );
?>


test.prg
Code: Select all  Expand view
function Main()

   ? "Hello world"

return nil

Re: mod_harbour for non dedicated servers

PostPosted: Wed Jan 12, 2022 4:18 pm
by Enrico Maria Giordano
I created a folder in my webspace and named it mod_harbour. Then I copied the following file in it:

test.prg
libcurl-x64.dll
modharbour.exe
test.php

Then I open the following url in my browser:

https://www.emagsoftware.it/mod_harbour/test.prg

I get: Errore HTTP 404.3 - Not Found

Then I tried with:

https://www.emagsoftware.it/mod_harbour/test.php

And I get: Warning: shell_exec() has been disabled for security reasons in D:\inetpub\webs\emagsoftwareit\mod_harbour\test.php on line 2

What I'm doing wrong?

EMG

Re: mod_harbour for non dedicated servers

PostPosted: Wed Jan 12, 2022 5:35 pm
by Antonio Linares
Enrico,

They don't allow it:
shell_exec() has been disabled for security reasons


many thanks for your feedback

Re: mod_harbour for non dedicated servers

PostPosted: Wed Jan 12, 2022 8:21 pm
by Enrico Maria Giordano
This is exactly what I was talking about. :-(

EMG

Re: mod_harbour for non dedicated servers

PostPosted: Thu Jan 13, 2022 1:24 pm
by cnavarro
Enrico Maria Giordano wrote:My web space is on a Windows server.

EMG

I also have Windows Server running without restrictions

Re: mod_harbour for non dedicated servers

PostPosted: Sun Jan 16, 2022 12:55 pm
by Antonio Linares
Enhanced version:

live tests:
https://www.fivetechsoft.com/counter/info.php
https://www.fivetechsoft.com/counter/modpro.php

test.php
Code: Select all  Expand view
<?php
   $result = shell_exec( "./modharbour test.prg" );
   print( substr( $result, strpos( $result, chr( 10 ).chr( 10 ) ) + 1 ) );
?>


run.php
Code: Select all  Expand view
<?php
   header('Access-Control-Allow-Origin: *');
   header('Access-Control-Allow-Methods: GET, POST');
   header("Access-Control-Allow-Headers: X-Requested-With");
   file_put_contents( "tmp.prg", $_POST["source"] );
   $result = shell_exec( "./modharbour tmp.prg" );
   print( substr( $result, strpos( $result, chr( 10 ).chr( 10 ) ) + 1 ) );
?>

Re: mod_harbour for non dedicated servers

PostPosted: Mon Jan 17, 2022 11:32 am
by Antonio Linares
See this and thanks to Lailton for his great help !!!

http://www.fivetechsoft.com/counter/modpro.php

mod_harbour modpro example working from BlueHost (where no mod_harbour setup is allowed being a non dedicated server) !!! (using the PHP bridge)

Re: mod_harbour for non dedicated servers

PostPosted: Thu Jan 20, 2022 3:34 am
by Lailton
You're welcome.

All looks nice :) good job.