FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour mod_harbour for non dedicated servers
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: mod_harbour for non dedicated servers
Posted: Wed Jan 12, 2022 01:08 PM

My web space is on a Windows server.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: mod_harbour for non dedicated servers
Posted: Wed Jan 12, 2022 01:16 PM
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 (fw): Select all Collapse
<?php
   print( shell_exec( "modharbour.exe test.prg" ) );
?>


test.prg
Code (fw): Select all Collapse
function Main()

   ? "Hello world"

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: mod_harbour for non dedicated servers
Posted: Wed Jan 12, 2022 04:18 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: mod_harbour for non dedicated servers
Posted: Wed Jan 12, 2022 05:35 PM
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: mod_harbour for non dedicated servers
Posted: Wed Jan 12, 2022 08:21 PM

This is exactly what I was talking about. :-(

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: mod_harbour for non dedicated servers
Posted: Thu Jan 13, 2022 01:24 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: mod_harbour for non dedicated servers
Posted: Sun Jan 16, 2022 12:55 PM
Enhanced version:

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

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


run.php
Code (fw): Select all Collapse
<?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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: mod_harbour for non dedicated servers
Posted: Mon Jan 17, 2022 11:32 AM
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
Posts: 231
Joined: Fri Jul 20, 2012 01:49 AM
Re: mod_harbour for non dedicated servers
Posted: Thu Jan 20, 2022 03:34 AM

You're welcome.

All looks nice :) good job.

Regards,

Lailton Fernando Mariano

Continue the discussion