小编LL.*_*LL.的帖子

在尝试执行php文件时,PHP无法打开Stream没有这样的文件或目录

嗨伙计们,我一直得到:

failed to open Stream: No such file or directory " Path " on line 2

当我尝试从命令行运行此php文件时.

require_once 'modules/Reports/ScheduledReports.php'
VTScheduledReport::runScheduledReports($adb);
Run Code Online (Sandbox Code Playgroud)

我已经检查过文件是否存在,并且有一个名为class VTScheduledReportin ScheduledReports.php的类和函数runScheduledReports.在那儿.该函数如下所示:

public static function runScheduledReports($adb) {
    require_once 'modules/com_vtiger_workflow/VTWorkflowUtils.php';
    $util = new VTWorkflowUtils();
    $adminUser = $util->adminUser();

    global $currentModule, $current_language;
    if(empty($currentModule)) $currentModule = 'Reports';
    if(empty($current_language)) $current_language = 'en_us';

    $scheduledReports = self::getScheduledReports($adb, $adminUser);
    foreach($scheduledReports as $scheduledReport) {
        $scheduledReport->sendEmail();
        $scheduledReport->updateNextTriggerTime();
    }
    $util->revertUser();
}
Run Code Online (Sandbox Code Playgroud)

任何人都知道为什么这不会运行?

php command-line

3
推荐指数
1
解决办法
2043
查看次数

图像不会从jar文件加载

我试过搜索但仍然没有得到解决方案.当我导出到jar文件时,我的所有图像突然不再起作用了.它们在eclipse中运行良好,我确保它们在jar文件中.我已经尝试使用get资源方法并使图像加载器类自动上升到目录树但它仍然失败.这是我做的:

public static Image load(String path)
{   String temp = path;
    Image image = null;
    try {

     image = new ImageIcon(path).getImage();


    } 

    catch ( Exception e )
    {   
        try {
         while (image == null )
         {
              image = new ImageIcon("../"+ path).getImage();
         }
         if ( path.equals("../../../../../../"+ temp))
         {
             while ( image ==null)
             {
                 image = new ImageIcon("./"+ path).getImage();
             }
         }
        }
        catch ( Exception ae)
        {


        System.err.println("cannot locate image");
    }} 


    return image;
}   
Run Code Online (Sandbox Code Playgroud)

我将发送它的路径如下:"doc/icon.png"

我已将所有图像放在doc文件夹中,结构是最终Project,里面有doc文件夹,然后是包含所有包的src文件夹.

java jar image

-1
推荐指数
1
解决办法
1446
查看次数

标签 统计

command-line ×1

image ×1

jar ×1

java ×1

php ×1