gpt4 book ai didi

php - Netbeans:如何配置远程服务器的 PHPUnit 路径?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:50:33 25 4
gpt4 key购买 nike

我在 Windows 上使用最新版本的 Netbeans,并将远程 Ubuntu Apache 服务器连接到 Zend Framework 项目。我在那台服务器上安装了 PHPUnit,但我不知道 phpunit.bat 的绝对路径是什么(我需要 NetBeans 选项中的绝对路径->Php->单元测试)。我在我的计算机上安装了 XAMPP 并尝试在 XAMPP 和远程服务器的项目中使用 PHPUnit,但我在包含路径方面遇到问题,例如我收到此错误:

'Warning: include_once(PHP\Invoker.php): failed to open stream: No
such file or directory in Y:\mos\public_html\library\Zend\Loader.php
on line 146
'.

这是我的 bootstrap.php 文件:

<?php
error_reporting( E_ALL | E_STRICT );
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
define('APPLICATION_PATH', realpath('Y:/mos/public_html' . '/application'));
define('APPLICATION_ENV', 'development');
define('LIBRARY_PATH', realpath('Y:/mos/public_html' . '/library'));
define('TESTS_PATH', realpath(dirname(__FILE__)));
$_SERVER['SERVER_NAME'] = 'http://mos.loc';
$includePaths = array(LIBRARY_PATH, get_include_path());
set_include_path(implode(PATH_SEPARATOR, $includePaths));
require_once "Zend/Loader/Autoloader.php";
$loader = Zend_Loader_Autoloader::getInstance();
$loader->setFallbackAutoloader(true);
$loader->suppressNotFoundWarnings(false);
Zend_Session::$_unitTestEnabled = true;
Zend_Session::start();
?>

我能否以某种方式设置 Netbeans 远程服务器上 PHPUnit 的绝对路径,或者我能否使用远程服务器中的项目和我的 XAMPP 中的 PHPUnit 使其工作?

最佳答案

也许您映射的网络驱动器未映射到运行 Web 服务器的任何帐户下。

在你自己的账号下,查看你的Y盘映射是什么:

C:\>net use

输出应该是这样的:

New connections will not be remembered.


Status Local Remote Network

-------------------------------------------------------------------------------
OK Y: \\server\share Microsoft Windows Network

然后修改您的 PHP 脚本以尝试为您的脚本目的映射驱动器:

<?php system("net use Y: \\server\share password /user:username /persistent:no >nul 2>&1"); ?>

关于php - Netbeans:如何配置远程服务器的 PHPUnit 路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13580046/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com