johnsmith153 Posted August 8, 2008 Share Posted August 8, 2008 This has literally been driving me crazy for 4 hours. I am on a Linux Server and want to access the command prompt. <?php shell_exec('home/accountname/MP4Box.exe -hint filename.3gp'); ?> Surely this should work? But it doesn't. How do I access the command prompt on a Linux Server? Or, how do I see any error message etc. that this is reporting - just shows blank screen. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/ Share on other sites More sharing options...
ratcateme Posted August 8, 2008 Share Posted August 8, 2008 i use back ticks for using shell like this echo `home/accountname/MP4Box.exe -hint filename.3gp`; Scott. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611354 Share on other sites More sharing options...
johnsmith153 Posted August 8, 2008 Author Share Posted August 8, 2008 i use back ticks for using shell like this echo `home/accountname/MP4Box.exe -hint filename.3gp`; Scott. That doesn't seem to work either. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611363 Share on other sites More sharing options...
True`Logic Posted August 8, 2008 Share Posted August 8, 2008 maybe exec will work for what you want, but use the actual harddrive path, not the url path. for instance// @exec("c:\~FULL\\PATH\\TO\\home\\accountname\\MP4Box.exe -hint filename.3gp") or die("Exec Failed at line <line number>"); Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611373 Share on other sites More sharing options...
RichardRotterdam Posted August 8, 2008 Share Posted August 8, 2008 linux does not have a c:\ d:\ or what ever those were full paths nor does it use executables unless you use wine Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611427 Share on other sites More sharing options...
RichardRotterdam Posted August 8, 2008 Share Posted August 8, 2008 linux does not have a c:\ d:\ or what ever those were full paths nor does it use executables (.exe)unless you use wine oops this was meant to be an edit not a quote Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611430 Share on other sites More sharing options...
DarkWater Posted August 8, 2008 Share Posted August 8, 2008 Yeah, can you even run that command from the shell normally? What happens when you do? Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611591 Share on other sites More sharing options...
johnsmith153 Posted August 8, 2008 Author Share Posted August 8, 2008 Yeah, can you even run that command from the shell normally? What happens when you do? Just so I am not a complete idiot: I access it via the "Command prompt" (I asume this is "Shell") In Windows XP using the Command Prompt it works perfectly. There is no support for Vista. My web host says that it wont work on Linux if it is Windows based - but I am sure the program says it does work on Linux. I am not some lazy arse who just wants you lot to do all the work - I have honestly tried everything. Although I suppose this is my first day at even looking at the command prompt - but I know an "ok" amount of php. The program is a great tool - may be of use to others if not know already. http://gpac.sourceforge.net/doc_mp4box.php http://www.softpedia.com/progDownload/MP4Box-Download-80065.html Somebody else said I may have permission problem? I wouldn't know what to do with this either !!?? Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611675 Share on other sites More sharing options...
DarkWater Posted August 8, 2008 Share Posted August 8, 2008 Does the path home/accountname/ even exist? I highly doubt that it exists like that. And yeah, .exe will not run on Linux. Maybe there's a separate download for Linux? And this has no GUI, right? It's just a command line tool? (Because PHP won't open GUI programs). Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611682 Share on other sites More sharing options...
Jabop Posted August 8, 2008 Share Posted August 8, 2008 In Windows XP using the Command Prompt it works perfectly. Because it's a WINDOWS command line. Not Linux. gg Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611683 Share on other sites More sharing options...
The Little Guy Posted August 8, 2008 Share Posted August 8, 2008 have you tried using some sort of shell program, such as PuTTY? Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611688 Share on other sites More sharing options...
RichardRotterdam Posted August 8, 2008 Share Posted August 8, 2008 I am a linux user and to make sure i wasn't mistaken i tried to run that .exe file. It will not run in linux unless you use some kind of windows emulator. how ever ......here is I think your mistake there is both a zip file and a .tar.gz on the sourceforge link http://gpac.sourceforge.net/home_download.php you need the tar.gz file which does not contain a exe file but the stuff you would expect for a linux app. you need that stuff not the MP4Box.exe Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-611860 Share on other sites More sharing options...
johnsmith153 Posted August 8, 2008 Author Share Posted August 8, 2008 I am a linux user and to make sure i wasn't mistaken i tried to run that .exe file. It will not run in linux unless you use some kind of windows emulator. how ever ......here is I think your mistake there is both a zip file and a .tar.gz on the sourceforge link http://gpac.sourceforge.net/home_download.php you need the tar.gz file which does not contain a exe file but the stuff you would expect for a linux app. you need that stuff not the MP4Box.exe Thanks for looking into this. However, I cant see anything relating to mp4box in the download link you gave. My download was called MP4Box, not GPAC Thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612052 Share on other sites More sharing options...
ratcateme Posted August 8, 2008 Share Posted August 8, 2008 did you download it and have a look it contains mp4box Scott. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612058 Share on other sites More sharing options...
johnsmith153 Posted August 9, 2008 Author Share Posted August 9, 2008 The Generic archive doesn't - but the Windows does. I can not use Windows. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612089 Share on other sites More sharing options...
ratcateme Posted August 9, 2008 Share Posted August 9, 2008 its there under gpac\applications\mp4box\ Scott. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612104 Share on other sites More sharing options...
johnsmith153 Posted August 9, 2008 Author Share Posted August 9, 2008 I'm an idiot. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612108 Share on other sites More sharing options...
johnsmith153 Posted August 9, 2008 Author Share Posted August 9, 2008 I haven't a clue what I am supposed to do with all that they've given me!! <php $filetoimport = "movie.3gp"; $filetoimport = hint for rtsp streaming; $filetoexport = "movie-hinted.3gp"; ?> Unlikely though. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612110 Share on other sites More sharing options...
RichardRotterdam Posted August 9, 2008 Share Posted August 9, 2008 did you install it first? Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-612258 Share on other sites More sharing options...
johnsmith153 Posted August 11, 2008 Author Share Posted August 11, 2008 I think the problem is - I haven't got a clue how to install it. I know what to type in directly to shell, and I know what to type in php, but without it being installed I suppose it aint gonna work (!!). I use hostmonster.com (shared server) and they allow you to install certain things - but not root access. I also have manual shell access via a terminal in a control panel when I log in on the hostmonster site. Where do I install it? I have 4 ".c" files I think it is. They dont really help enough. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-613536 Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 You need to compile it. I'll assume it has a Makefile, otherwise you'll need to write one up yourself (not fun if you don't know what you're doing). ./configure make make install That's the general "install" sequence for MOST programs these days on Linux that require you to compile. If it doesn't have a configure tool or a Makefile....>_> You'll need to research them and write it yourself. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-613541 Share on other sites More sharing options...
Minase Posted August 11, 2008 Share Posted August 11, 2008 no change to run .exe files on linux directly even in you have wine you need to specify another arguments,but i doubt it will work. if you did buy the hosting (not home machine) than you can forget exes what are you trying to do actually? geting file info or play it? Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-613560 Share on other sites More sharing options...
johnsmith153 Posted August 13, 2008 Author Share Posted August 13, 2008 After many hours doing this - my research is complete - I think I now know what I am doing. Problem is, I have now found that my web host "hostmonster.com" dont allow me to use MP4Box because it is too processor intensive. Thanks Hostmonster. --- Thanks for all the help with this. Quote Link to comment https://forums.phpfreaks.com/topic/118735-how-do-i-access-command-line-from-php/#findComment-615433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.