Compiling and running programs on webserver

software development


I am starting to run into some programming problems that I think could be solved a lot more efficiently with a “real” program in Java or C (or heck, even Fortran) rather than a PHP script.

I’m just wondering how feasible it is to code some simple non-interactive application, install a free compiler (PHP can be installed, after all), and then use exec() or system() to call it through PHP… is this allowed? Even possible?

Has anyone tried this?


I’ve compiled a few things on a server. The usual gcc, etc. is already there, although people have reported having difficulty because their prerequisites weren’t already there. You may install and run programs as long as there’s no server disruption. Mine reports:

Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: …/src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)

Even FORTRAN 77. :wink:

They recently hired more support help.
DreamHost Customers wiki And Forum


Hm, I’ll try that! :slight_smile:

(Unfortunately, the only programming languages I can use are Java and FORTRAN 90 - although picking up a bit of C++ hopefully shouldn’t be too tricky).