[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2016-09-20
7
Medium Priority
?
63 Views
Last Modified: 2016-09-30
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.
0
Comment
Question by:altariamx2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41808100
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.
0
 
LVL 9

Expert Comment

by:Brian Tao
ID: 41808137
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

0
 

Author Comment

by:altariamx2003
ID: 41808817
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??
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 41808873
'*.so' (for shared object) is the basic equivalent to Windows DLLs.  However, as Brian described above, it is not that simple.  Your program must be written to show the appropriate data to the web server.  This is not the same as just showing it on the screen.
0
 
LVL 9

Assisted Solution

by:Brian Tao
Brian Tao earned 1000 total points
ID: 41808918
What kind of files do i need to compile to use it in my linux server to do the same in linux???
I don't know Fortran, but I know that on a Linux machine, the similar thing to Windows DLL (dynamic link library) is .so file (Shared Object).  As of how........... sorry that I cannot help.

with the exec function in php could I run a fortran code in my server linux??
With the exec() function you can call any linux commands or programs.  For example,
exec('ls', $output, $return_var);

Open in new window

will run "ls" (like "dir" in Windows), return the result (the list of files and folders) into $output (an array of strings), and the returned status in $return_var.

So let's say you run your local program (from command-line) like this: local_program para1 para2, then your PHP statement will be
exec('local_program para1 para2', $output, $return_var);

Open in new window

0
 

Accepted Solution

by:
altariamx2003 earned 0 total points
ID: 41814851
sorry guys i was with some troubles, thx for your time guys.

I gonna keep looking for the answer in other forums
0
 

Author Closing Comment

by:altariamx2003
ID: 41823168
i gonna close the question bcause i was looking for someone that knows something about fortran

thx anyway
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question