Page 2 of 2

Re: Command line funciton

Posted: Sun Jul 20, 2008 10:12 pm
by JellyFish
omniuni wrote:This is a windows program and will not work under your Linux server, unless you configure it with WINE somehow.

I'm sorry,

-OmniUni
I figured that would be the case.

Does anyone know of a linux version of a FLVMDI? I'll do some googling.

Thanks guys.

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:20 pm
by omniuni
http://rubyforge.org/projects/flvtool2/

but you will need a server that supports ruby.

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:39 pm
by JellyFish
I'll check into that one as well, but I've also found:

http://yamdi.sourceforge.net/

This looks like it would work? It says on the site:
yamdi should run under *BSD, Linux and Win32 (tested with FreeBSD, MacOSX, Ubuntu and Windows XP)...

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:46 pm
by omniuni
Indeed, that looks like it should work, but you will need to compile it on a similar platform to your server. In other words, find out what GCC version, major kernel version, etc. and make sure you compile it on said system, if not, it may reject the executable, if it will even allow PHP to execute a binary that you upload.

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:52 pm
by JellyFish
omniuni wrote:Indeed, that looks like it should work, but you will need to compile it on a similar platform to your server. In other words, find out what GCC version, major kernel version, etc. and make sure you compile it on said system, if not, it may reject the executable, if it will even allow PHP to execute a binary that you upload.
Hmm, any suggestions on how to compile the source file on my server? Would I have to install GCC on my server then run a command that compiles the yamdi.c?

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:52 pm
by JellyFish
omniuni wrote:Indeed, that looks like it should work, but you will need to compile it on a similar platform to your server. In other words, find out what GCC version, major kernel version, etc. and make sure you compile it on said system, if not, it may reject the executable, if it will even allow PHP to execute a binary that you upload.
I tried compiling the source code on my machine and then uploading the executable to my server, and I don't think my server is accepting it.

Hmm, any suggestions on how to compile the source file on my server? Would I have to install GCC on my server then run a command that compiles the yamdi.c maybe?

Re: Command line funciton

Posted: Sun Jul 20, 2008 11:58 pm
by omniuni
You'll likely have to get SSH access.

Especially if this is on a goDaddy server, though, I seriously doubt that they're going to be OK with this.

However, if you get SSH access, you should be able to just remote into the server, WGET the source files, and run the compile commands there. It is unusual, however, for this to be allowed on shared servers.

Just as a side note, did you check the permissions on the executable?

Re: Command line funciton

Posted: Mon Jul 21, 2008 12:16 am
by JellyFish
Permissions on the file are 755.

Do you think that where you compile a program has an effect on it's compatibility? I wouldn't have thought that, considering that a C compiler is a program that is not a property of say Microsoft or any biased company.

Re: Command line funciton

Posted: Mon Jul 21, 2008 12:32 am
by omniuni
The compilation is done for whatever the host system is.

If you use gcc on windows, it compiles for windows, and optimized for your specific processor and architecture.

Use gcc on Linux, and the result will be a Linux executable, again, optimized for your kernel version and processor.

Different compilers may have different efficiencies, but the bottom line is that while the C language may not be specific to a company like Microsoft, Windows is. It is the Kernel, not the processor that determines, technically, whether a binary will run.

Since ntoskrnl.exe and Linux are two very different kernels, compiling on a machine with one will not work on the other. You may, however, be lucky enough to get a binary from a linux 2.6.x to run on a different 2.6.x or a binary for WinXP to run on Vista.

This is why there is such a problem with programs that work only on Windows. It's not that the code could not be easily written to be cross-platform, but the companies don't feel like spending the time to compile and support Linux or MacOS versions, and they are certainly not going to give the code to the community so that they could make a native version.

WINE is a compatibility layer that tries to make Windows executables work on *nix systems by translating system calls. It's an interesting process, and WINE is getting better every day. In other words, the WINEserver actually serves as a "pseudo windows kernel" allowing Linux to execute a program that was originally compiled under Windows.

Re: Command line funciton

Posted: Mon Jul 21, 2008 4:23 am
by padduweb
JellyFish wrote:Is there a function in php that allows me to execute a command on the command-line or shell? I remember coming across one but don't remember what the name of it was. I checked on php.net and couldn't find it. Eeek.

Is there such a thing or am I mistaken?
Yes Check this site for answer
http://php-answers.blogspot.com/2008/07 ... mmand.html

Re: Command line funciton

Posted: Mon Jul 21, 2008 11:11 am
by omniuni
Note that as per the rest of this thread, the method of execution is not the problem, but the OS compatibility.