403Webshell
Server IP : 104.21.17.213  /  Your IP : 216.73.217.141
Web Server : Apache
System : Linux hosting01.arsenalhost.com 4.18.0-425.13.1.lve.el8.x86_64 #1 SMP Mon Feb 27 15:23:24 EST 2023 x86_64
User : corbizre ( 1013)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/lve/modlscapi/buildlsphp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/lve/modlscapi/buildlsphp/cmd_buildmatchingphp.php
<?php
/*
 * Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2026 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * http://cloudlinux.com/docs/LICENSE.TXT
 */

/******************************
 * cmd_buildmatchingphp.php
 *
 * Options:
 * 		-f force build even it is matched
 * 		-v verify version and config options, no actual build
 * 		default no option: build the matching php if there is difference.
 *
 * Command line tool to build Apache matching PHP.
 * This requires that existing php has been successfully built by whm EasyApache tool.
 * You can make this as part of your automated server installation script after EasyApache build done.
 *
 ******************************/

ini_set('max_execution_time', 7200);

require_once('WhmMod_LiteSpeed_BuildPHP.php');

define ('PHP_AP_LOC', '/usr/local/bin/php');	// Apache PHP location
define ('LSWS_HOME', '/usr/local/lsws');

define( 'CGI_DIR', '/usr/local/cpanel/whostmgr/docroot/cgi/lsws' );
define( 'WGET_TEMP', '/usr/src/lsws' );
$path_to_bld = "";

$buildtool = new WhmMod_LiteSpeed_BuildPHP();

$next = $buildtool->PrecheckPHPVersion(PHP_AP_LOC, $msg);
echo "$msg \n";

// return 0: same, 1 different; 2 error stop;
$do_build = FALSE;

if ($next == 2) {
	echo "Please make sure PHP exists, you can specify a different location by editing variable definition PHP_AP_LOC \n";
}
elseif (isset($argv[1]) && $argv[1] == '-v') {
	echo "Verify only - Exit!\n";
}
elseif ($next == 0) {
	if (isset($argv[1]) && $argv[1] == '-f') {
		echo "Config option is same, will do force rebuild matching php";
		$do_build = TRUE;
	}
	else {
		echo "No need to rebuild. Aborted! If you want to do force rebuid, add parameter -f \n";
	}
}
else { // next == 1
	$do_build = TRUE;
}

if ((isset($argv[1])) && ($argv[1] != '-f') && ($argv[1] != '-v')) {
    $path_to_bld = trim($argv[1]);
}

if (!$do_build)
	exit;

echo "Next will build lsphp using the same configuration as Apache's php.
	This will download the source code and build php binary. The whole process may take more than 10 minutes, please be patient.\n";

$curdir = getcwd();
if ($curdir != CGI_DIR) {
	echo "change current directory to " . CGI_DIR . "\n";
	chdir(CGI_DIR);
}

$result = $buildtool->GenerateBuildScript(PHP_AP_LOC, $path_to_bld);
if (isset($result['error'])) {
	echo "{$result['error']} \n Aborted!\n";
	return false;
}

$build_script = $result['file'];

echo "build script generated at $build_script \n";

system($build_script);


Youez - 2016 - github.com/yon3zu
LinuXploit