修复phpinfo显示

pull/109/head
midoks 6 years ago
parent b414ce369f
commit 614899a247
  1. 23
      class/core/plugins_api.py
  2. 5
      plugins/php/conf/php56.ini
  3. 17
      plugins/php/index.py
  4. 4
      plugins/php/js/php.js
  5. 3
      route/static/app/site.js

@ -252,11 +252,26 @@ class plugins_api:
public.execShell("rm -rf " + plugin_path) public.execShell("rm -rf " + plugin_path)
return public.returnJson(False, '安装失败!') return public.returnJson(False, '安装失败!')
# 由于内容太大无法shell输出,暂时移动的插件模块中
def phpinfoApi(self): def phpinfoApi(self):
version = request.form.get('version', '') v = request.form.get('v', '')
phpinfo = public.httpGet( sys.path.append("plugins/php")
'http://127.0.0.1/' + version + '/phpinfo.php')
return phpinfo import index
content = index.getPhpinfo(v)
return content
# self.checkPhpinfoFile(version)
# infoPath = public.getRootDir() + '/phpinfo'
# sPath = infoPath + '/' + version
# public.execShell('rm -rf ' + infoPath)
# public.execShell('mkdir -p ' + sPath)
# public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>')
# url = 'http://127.0.0.1/' + version + '/phpinfo.php'
# phpinfo = public.httpGet(url)
# os.system("rm -rf " + infoPath)
# return phpinfo
##### ----- end ----- ### ##### ----- end ----- ###
# 进程是否存在 # 进程是否存在

@ -212,8 +212,3 @@ ldap.max_links = -1
[dba] [dba]
[curl] [curl]
[Zend Opcache] [Zend Opcache]
;[xhprof]
;extension=md_xhprof.so
;xhprof.output_dir="MD:/bin/tmp/xhprof"

@ -484,8 +484,8 @@ def setDisableFunc(version):
def checkPhpinfoFile(v): def checkPhpinfoFile(v):
if public.isInstalledWeb(): if public.isInstalledWeb():
desc_file = public.getServerDir() + '/openresty/nginx/conf/php_status/phpinfo_' + \ desc_file = public.getServerDir(
str(v) + '.conf' ) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
if not os.path.exists(desc_file): if not os.path.exists(desc_file):
tpl = getPluginDir() + '/conf/phpinfo.conf' tpl = getPluginDir() + '/conf/phpinfo.conf'
content = public.readFile(tpl) content = public.readFile(tpl)
@ -496,15 +496,14 @@ def checkPhpinfoFile(v):
def getPhpinfo(v): def getPhpinfo(v):
checkPhpinfoFile(v) checkPhpinfoFile(v)
sPath = public.getRootDir() + '/phpinfo/' + str(v) sPath = public.getRootDir() + '/phpinfo/' + v
# public.execShell("rm -rf " + public.getRootDir() + '/phpinfo') public.execShell("rm -rf " + public.getRootDir() + '/phpinfo')
public.execShell("mkdir -p " + sPath) public.execShell("mkdir -p " + sPath)
public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>') public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>')
# print 'http://127.0.0.1/' + str(v) + '/phpinfo.php' url = 'http://127.0.0.1/' + v + '/phpinfo.php'
phpinfo = public.httpGet('http://127.0.0.1/' + str(v) + '/phpinfo.php') phpinfo = public.httpGet(url)
public.writeFile('/tmp/phpinfo.txt', phpinfo) os.system("rm -rf " + public.getRootDir() + '/phpinfo')
# os.system("rm -rf " + public.getRootDir() + '/phpinfo') return phpinfo
return ''
def getLibConf(version): def getLibConf(version):

@ -378,7 +378,7 @@ function getPhpinfo(version) {
} }
//获取PHPInfo //获取PHPInfo
function getPHPInfo(version) { function getPHPInfo_old(version) {
phpPost('get_phpinfo', version, '', function(data){ phpPost('get_phpinfo', version, '', function(data){
var rdata = data.data; var rdata = data.data;
layer.open({ layer.open({
@ -393,7 +393,7 @@ function getPHPInfo(version) {
} }
//获取PHPInfo //获取PHPInfo
function getPHPInfo_new(version) { function getPHPInfo(version) {
$.post('/plugins/phpinfo', {v:version}, function(data) { $.post('/plugins/phpinfo', {v:version}, function(data) {
layer.open({ layer.open({
type: 1, type: 1,

@ -984,8 +984,7 @@ function setIndexList(id){
/*站点修改*/ /*站点修改*/
function webEdit(id,website,endTime,addtime){ function webEdit(id,website,endTime,addtime){
var eMenu = ''; var eMenu = "<p onclick='dirBinding("+id+")' title='子目录绑定'>子目录绑定</p>"
eMenu = "<p onclick='dirBinding("+id+")' title='子目录绑定'>子目录绑定</p>"
+"<p onclick='webPathEdit("+id+")' title='网站目录'>网站目录</p>" +"<p onclick='webPathEdit("+id+")' title='网站目录'>网站目录</p>"
+"<p onclick='limitNet("+id+")' title='流量限制'>流量限制</p>" +"<p onclick='limitNet("+id+")' title='流量限制'>流量限制</p>"
+"<p onclick=\"rewrite('"+website+"')\" title='伪静态'>伪静态</p>" +"<p onclick=\"rewrite('"+website+"')\" title='伪静态'>伪静态</p>"

Loading…
Cancel
Save