![](/img/trans.png)
[英]java file executed from command line but not from browser(apache)?
[英]Java file executed in command line but not in browser
我是linux新手并将网页连接到服务器。
我正在开发一个项目,该项目需要一个html页面来执行Linux服务器中的java文件,并将输出显示在网页中。
当我从linux的命令行执行php文件时,一切都很成功,它在java和shell脚本中显示测试打印注释,它从java代码和shell代码创建一个文件。
但是当我从浏览器执行时
问题#1 - 它不会从shell脚本创建文件,但会显示测试打印语句
问题#2 - 它根本不执行java代码,因此不创建文件或打印语句。
如果我从浏览器执行这些shell和java代码,你能告诉我是否必须启用或更改设置吗?
to 777 for time being. 我暂时将的权限设置为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
如果您使用Centos,selinux可能存在一些问题。
禁用selinux的命令是linux命令提示符下的“setenforce 0”。
似乎内存是问题... Java没有获得所需的内存,令人惊讶的是它只有2555904字节= 2.5MB !! 请尝试增加php.ini中的内存限制
memory_limit = 10M
至少
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.