Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

¿How to run program library from a webpage(php)?

Hi

I would like to know ¿if it is possible to run fortran compiled libraries in a webpage?

Today I made a "fortran compiled library" (ddl) and a local program that send info to the fortran ddl file to process something and return data to the local program to present the info.

But when I present the project my boss request me to do the same but in a webpage and for real I had to much clue about what I need to do.

1.- In my job we had a dedicated server with linux as a OS and I presume that i need to install a fortran version, but what version should be better.


2.- In this case i assume that I need to do a php form with some input box to collect info and send it by get or post to a fortran compiled library and return the result to another php page.
     
     - As you know in windows you can do a ddl compiled files to add them to a program and do "things", my question  will be in linux can i do somekind a compiled library (like dll in windows) to call the compiled fortran module from the php page or there is another way to do this.

Sorry if this question are a little dump but im really newbie on linux.

Best regards.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

On a web page in your browser, you are not normally allowed to directly run programs like that.  Sometimes you can set up a program to run as a 'CGI' program thru the web server and browser but that requires the program to be set up to do that and return the correct header info for a web page.  This is true on both Windows and Linux.
It doesn't sound like a good idea.  A better way (as I'm a PHP'er) is to rewrite the feature using PHP since you're going to write a PHP form trying to use that Fortran ddl.
But if there's no other choice, the idea will be the following:
  1. modify the local program to accept command line parameters for whatever you want to send to the ddl
  2. modify the local program so that it output what you "present the info" as text strings
  3. in your php script, use the function exec() to run the program, get the output and present it on the webpage
The definition of exec() function:
// definition:
// string exec ( string $command [, array &$output [, int &$return_var ]] )

Open in new window

Avatar of altariamx2003

ASKER

Hi guys

First of all thx a lot to take the time to answer my post, you guys are awesome.


At this moment I have access to the linux server (dedicated server), so that is  not a problem.

I know that ddl files are from windows, bcause im not so good on linux i was asking about what is the alternative to ddl's on linux, bcause i know that thouse files usually only works on windows.

What kind of files do i need to compile to use it in my linux server to do the same in linux???

with the exec function in php could I run a fortran code in my server linux??
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i gonna close the question bcause i was looking for someone that knows something about fortran

thx anyway