【发布时间】:2014-06-05 01:29:26
【问题描述】:
我是 linux 新手,将网页连接到服务器。
我正在做一个项目,该项目需要一个 html 页面来在 Linux 服务器中执行一个 java 文件并将输出显示在一个网页中。
- 我创建了一个在命令行中执行良好的 javafile,并创建了一个 results.txt 文件。
- 我创建了一个成功执行其中的 javafile 的 shell 脚本。
- 一个 html 页面,我在其中编写了 ajax 来触发 first.php 文件来执行上述 shell 脚本。
当我在 linux 中从命令行执行 php 文件时,一切都成功了,它在 java 和 shell 脚本中显示测试打印 cmets,它从 java 代码和 shell 代码创建一个文件。
但是当我从浏览器执行时
问题 #1 - 它不会从 shell 脚本创建文件,但会显示测试打印语句
问题 #2 - 它根本不执行 java 代码,所以不创建文件也不打印语句。
如果我从浏览器执行这些 shell 和 java 代码,你能告诉我是否必须启用或更改设置吗??
我已经将public_html的权限设置为777了。
Error From browser:Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fcf589ac000, 2555904, 1) failed; error='Permission denied' (errno=13) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (malloc) failed to allocate 2555904 bytes for committing reserved memory. # An error report file with more information is saved as: # /tmp/hs_err_pid306.log
【问题讨论】:
标签: java php linux apache shell