当前位置:  开发笔记 > 编程语言 > 正文

ubuntu - jenkins自动构建laravel 4时,phpunit执行时vendor/autoload.php报语法错误

在同一个环境下,php在终端使用ant构建项目执行phpunit测试没有问题,但是在jenkins自动构建时会报错:phpunit:[exec]PHPParseerror:syntaxerror,unexpected'<<'(T_SL)invarlibjenkinsjobs
在同一个环境下,php在终端使用ant构建项目执行phpunit测试没有问题,但是在jenkins自动构建时会报错:

phpunit:
[exec] PHP Parse error: syntax error, unexpected '<<' (T_SL) in /var/lib/jenkins/jobs/hwawoontest/workspace/vendor/autoload.php on line 7
[exec] PHP Stack trace:
[exec] PHP 1. {main}() /usr/local/bin/phpunit:0
[exec] PHP 2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:612
[exec] PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:138
[exec] PHP 4. PHPUnit_TextUI_Command->handleArguments() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:148
[exec] PHP 5. PHPUnit_TextUI_Command->handleBootstrap() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:651
[exec] PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:817
[exec] PHP 7. PHPUnit_Util_Fileloader::load() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:77
[exec] PHP 8. include_once() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:93

BUILD FAILED
/var/lib/jenkins/jobs/hwawoontest/workspace/build.xml:168: exec returned: 255


autoload.php的代码:

// autoload.php @generated by Composer
require_once DIR . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit34c7d9c593778809996626035f6ae5ee::getLoader();

下面这一段是build.xml的代码片段:


    
        
        
        
        
    

为什么会这样,哪里有问题?

回复内容:

在同一个环境下,php在终端使用ant构建项目执行phpunit测试没有问题,但是在jenkins自动构建时会报错:

phpunit:
[exec] PHP Parse error: syntax error, unexpected '<<' (T_SL) in /var/lib/jenkins/jobs/hwawoontest/workspace/vendor/autoload.php on line 7
[exec] PHP Stack trace:
[exec] PHP 1. {main}() /usr/local/bin/phpunit:0
[exec] PHP 2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:612
[exec] PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:138
[exec] PHP 4. PHPUnit_TextUI_Command->handleArguments() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:148
[exec] PHP 5. PHPUnit_TextUI_Command->handleBootstrap() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:651
[exec] PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:817
[exec] PHP 7. PHPUnit_Util_Fileloader::load() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:77
[exec] PHP 8. include_once() phar:///usr/local/bin/phpunit/phpunit/Util/Fileloader.php:93

BUILD FAILED
/var/lib/jenkins/jobs/hwawoontest/workspace/build.xml:168: exec returned: 255


autoload.php的代码:

// autoload.php @generated by Composer
require_once DIR . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit34c7d9c593778809996626035f6ae5ee::getLoader();

下面这一段是build.xml的代码片段:


    
        
        
        
        
    

为什么会这样,哪里有问题?

推荐阅读
携手相约幸福
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有