VenDiddy Posted April 9, 2007 Share Posted April 9, 2007 Hi all. I have installed MediaWiki on my computer (localhost) which is running Windows XP and WAMP. The problem is, I'm trying to install mathematics support for it. I've been troubleshooting for two days and have finally narrowed the problem down to this line: $contents = `$cmd`; This is located in my Math.php file. I believe Math.php generates a command and stores it in $cmd. The line $contents = `$cmd` executes the command and stores the returned output in $contents. Here is what is contained in $cmd before the line I've shown is executed: texvc.exe "C:\wamp\www\wiki\images\tmp" "C:\wamp\www\wiki\images\tmp" "x+y" "UTF-8" I've found that after the $contents = `$cmd` line is executed, $contents is just equal to "". However, If I paste the exact contents of $cmd into the windows command prompt and hit the Enter key, texvc.exe properly executes, displays output, and creates a .png file. When I try using a different executable for debugging purposes (I copied help.exe from C:\Windows\system32\ into C:\wamp\www\wiki and renamed it to help2.exe) $contents properly contains the output of the .exe file. My question is: what would cause an .exe file to execute properly in the command prompt but not execute through php? Thanks. Link to comment https://forums.phpfreaks.com/topic/46337-solved-trouble-running-exe-file/ Share on other sites More sharing options...
Glyde Posted April 9, 2007 Share Posted April 9, 2007 Try: exec($cmd, $contents); Then try to print the value of $contents. Link to comment https://forums.phpfreaks.com/topic/46337-solved-trouble-running-exe-file/#findComment-225459 Share on other sites More sharing options...
VenDiddy Posted April 10, 2007 Author Share Posted April 10, 2007 I took your suggestion but it still doesn't output anything. I'm suspecting it might have to do something with texvc.exe calling other executables from my program files directory, but I'm new to this. Link to comment https://forums.phpfreaks.com/topic/46337-solved-trouble-running-exe-file/#findComment-225540 Share on other sites More sharing options...
VenDiddy Posted April 10, 2007 Author Share Posted April 10, 2007 Okay, I've made yet a little more progress. I have managed to extract this error from texvc.exe: Fatal error: cannot load shared library dllunix Reason: The specified module could not be found. I'm confused as to why this error is thrown when PHP runs texvc.exe and everything works fine when I run it from the command prompt. ??? Link to comment https://forums.phpfreaks.com/topic/46337-solved-trouble-running-exe-file/#findComment-225591 Share on other sites More sharing options...
VenDiddy Posted April 10, 2007 Author Share Posted April 10, 2007 Okay. I finally fixed the problem Woohoo!! The problem ended up being a really obscure one. I had to go find dllunix in the Objective Caml directory and copy it into my www folder. *Whew* Link to comment https://forums.phpfreaks.com/topic/46337-solved-trouble-running-exe-file/#findComment-225595 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.