mod_harbour for non dedicated servers

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

Re: mod_harbour for non dedicated servers

Post 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

<?php
   print( shell_exec( "modharbour.exe test.prg" ) );
?>


test.prg

Code: Select all | Expand

function Main()

   ? "Hello world"

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: mod_harbour for non dedicated servers

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

Re: mod_harbour for non dedicated servers

Post by Antonio Linares »

Enrico,

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


many thanks for your feedback
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: mod_harbour for non dedicated servers

Post by cnavarro »

Enrico Maria Giordano wrote:My web space is on a Windows server.

EMG

I also have Windows Server running without restrictions
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

Re: mod_harbour for non dedicated servers

Post 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

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


run.php

Code: Select all | Expand

<?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 ) );
?>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42508
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 30 times
Been thanked: 72 times
Contact:

Re: mod_harbour for non dedicated servers

Post 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)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Lailton
Posts: 169
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Has thanked: 2 times
Been thanked: 6 times
Contact:

Re: mod_harbour for non dedicated servers

Post by Lailton »

You're welcome.

All looks nice :) good job.
Regards,
Lailton Fernando Mariano
Post Reply