nahidshahin Posted June 13, 2008 Share Posted June 13, 2008 Hi, I want to run a Java program form my PHP code using shell_exec command. But problem is it works in my local apache server but not on remote server. In remote server it gives 'Error occurred during initialization of VM Could not reserve enough space for object heap' Can any one point out what is different in remote server than my local server? $java_cmd = "java -cp some_jar.jar JavaClassName $target_path $outputFile"; $java = shell_exec($java_cmd); echo("\n\noutput " . $java) This java command runs perfectly in remote server's command prompt. I have to add some jar in classpath which is of 6MB in size. I have removed that 6MB jar but still gives the same error. I'm surprised even java -Xms512m -Xmx1024m -XX:MaxPermSize=128m -version Or simply java -version also gives same error. It means that simple VM can't starts form PHP Can anyone help me please? Thanks Regards -Nahid Quote Link to comment https://forums.phpfreaks.com/topic/110037-problem-of-shell_exec-in-php/ Share on other sites More sharing options...
nahidshahin Posted June 13, 2008 Author Share Posted June 13, 2008 I have tried with exec instead of shell_exec But the same problem Quote Link to comment https://forums.phpfreaks.com/topic/110037-problem-of-shell_exec-in-php/#findComment-564696 Share on other sites More sharing options...
tapos Posted June 13, 2008 Share Posted June 13, 2008 may be its your permission problem. Please check your permission Quote Link to comment https://forums.phpfreaks.com/topic/110037-problem-of-shell_exec-in-php/#findComment-564698 Share on other sites More sharing options...
nahidshahin Posted June 13, 2008 Author Share Posted June 13, 2008 Thanks Pal for your reply. For the time-being I've changed the permission with 777 'chmod -R 777 *' but still the same error 'Could not reserve enough space for object heap' Quote Link to comment https://forums.phpfreaks.com/topic/110037-problem-of-shell_exec-in-php/#findComment-564699 Share on other sites More sharing options...
nahidshahin Posted June 14, 2008 Author Share Posted June 14, 2008 Hi, I've tried with separate shell script invoke by exec("run.sh"). My run.sh invoke that java, but still same problem. Most probably Apache can't invoke JVM. Is there any alternative to run that Java program? Anyway to make different thread, or any other technique? My need is very simple , just run that java program with some parameters and placing some jars in classpath. Thanks Regards -Nahid Quote Link to comment https://forums.phpfreaks.com/topic/110037-problem-of-shell_exec-in-php/#findComment-565472 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.