有一些问题集成PHP和R.我在这篇文章中工作:
http://www.r-bloggers.com/integrating-php-and-r/
已安装R并使用我们的R脚本验证:
Rscript C:\inetpub\wwwroot\client\includes\decisionTreePredictor.R 20 10 O 1000 10000 5000 0.2 10.2
Run Code Online (Sandbox Code Playgroud)
打印由其计算结果的单个值:
[1] "0"
Run Code Online (Sandbox Code Playgroud)
(Rscript.exe的路径在Windows环境变量中设置)
我有一个使用exec()的PHP脚本,它使用以下命令成功测试:
$result = exec('dir',$output,$returnVar);
echo "<br>result ". print_r($result,true);
echo "<br>output <pre>". print_r($output,true) , "</pre>";
echo "<br>return ". print_r($returnVar,true);
Run Code Online (Sandbox Code Playgroud)
返回:
result 2 Dir(s) 117,749,354,496 bytes free
output
Array
(
[0] => Volume in drive C is C_DRIVE
[1] => Volume Serial Number is 7EB2-A074
[2] =>
[3] => Directory of C:\inetpub\wwwroot\client\temp
[4] =>
[5] => 05/17/2014 10:29 PM .
[6] => 05/17/2014 10:29 PM …Run Code Online (Sandbox Code Playgroud) 我得到一个内存耗尽错误,我不应该占用任何内存!
该应用程序位于Windows 8 Server/IIS i/PHP 5.5/CodeIgniter/MS SQL Server上
错误如下:
[2014年5月23日10:56:57 America/New_York] PHP致命错误:在C:\ inetpub\wwwroot\application\models\DW_import.php上允许的内存大小为134217728字节耗尽(试图分配1992字节) 112
[23-May-2014 11:07:34 America/New_York] PHP致命错误:在C:\ inetpub\wwwroot\application\models\DW_import.php上允许的内存大小为134217728字节耗尽(试图分配2438字节) 113
该脚本在目录中查找几个不同的CSV文件以导入数据库.请记住,导入文件很大,有些高达4 Gigs的数据.据我所知,没有变量不断聚合可能导致此问题的数据.正在运行的脚本(模型)(此控制器没有视图,只有模型)如下:
DW_import.php
<?php
class dw_import extends CI_Model {
public function import(){
global $file,$errLogFile,$logFile,$tableName, $fieldList, $file, $count, $line, $query;
$this->load->database(); // init db connection
// map file types to database tables
$fileToDBArr = array(
'Customers' => 'customer',
'Customers_Historical' => 'customer_historical',
'Orders' => 'order',
'Customer_AR_Aggs' => 'customer_ar_aging_agg'
);
// extend timeout of this script
ini_set('max_execution_time', 3600);
// error handler to log …Run Code Online (Sandbox Code Playgroud) 我有一个使用SFTP连接下载文件的应用程序.它在PHP 5.6中正常工作,而不是在PHP 7中工作.我得到的错误如下:
PHP警告:filesize():ssh2.sftp的stat失败...
我的代码如下:
public function retrieveFiles($downloadTargetFolder,$remoteFolder = '.') {
$fileCount = 0;
echo "\nSftpFetcher retrieveFiles\n";
$con = ssh2_connect($this->host,$this->port) or die("Couldn't connect\n");
if($this->pubKeyFile){
$isAuth = ssh2_auth_pubkey_file($con, $this->user, $this->pubKeyFile, $this->privKeyFile);
} else {
$isAuth = ssh2_auth_password($con, $this->user, $this->pass);
};
if ($isAuth) {
$sftp = ssh2_sftp($con);
$rd = "ssh2.sftp://{$sftp}{$remoteFolder}";
if (!$dir = opendir($rd)) {
echo "\nCould not open the remote directory\n";
} else {
$files = array();
while (false != ($file = readdir($dir))) {
if ($file == "." || $file == …Run Code Online (Sandbox Code Playgroud) 我要求将一个画面报告嵌入到另一个网页中.我们正在使用画面JS:
http://onlinehelp.tableau.com/current/server/en-us/embed_code.htm
问题是:是否有一个身份验证选项,我们的应用程序(网页)可以将身份验证凭据传递给Tableau,因此用户无需输入凭据?
谢谢!
php ×2
codeigniter ×1
iis-8 ×1
php-7 ×1
r ×1
sql-server ×1
ssh2-sftp ×1
tableau-api ×1
windows-8 ×1
windows-8.1 ×1