PHP build for Jenkins failing with #39;Cannot run program quot;phplocquot;#39;(Jenkins 的 PHP 构建失败并出现“无法运行程序“phploc)
问题描述
尝试运行构建脚本时出现以下错误.
I'm getting the following error when attempting to run my build script.
/var/lib/jenkins/jobs/IPS (trunk)/workspace/build.xml:62: Execute failed: java.io.IOException:
Cannot run program "phploc": java.io.IOException: error=2, No such file or directory
我尝试切换到 jenkins 用户并且能够顺利运行脚本.我还检查了 $PATH 并尝试重新安装.运气不好!
I tried switching to the jenkins user and was able to run the script without a hitch. I also checked the $PATH and tried reinstalling. No luck!
- CentOS 5/6
- PHP 5.4(Zend 服务器)
- 詹金斯 1.477
- PHP QA 组件(最新)
推荐答案
我终于想通了...检查 $PATH 变量在这种情况下没有帮助.运行 Jenkins 作业时不执行各种 shell 启动文件,因此未正确填充 $PATH 变量.这可以通过以下三个步骤来解决:
I finally figured this out... checking the $PATH variable is not helpful in this context. The various shell startup files are not executed when running a Jenkins job, so the $PATH variable was not being properly populated. This can be remedied by following the three steps below:
- 点击管理 Jenkins
- 点击配置系统
- 添加名称为
PATH且值为$PATH:/usr/local/zend/bin的新环境变量.
- Click Manage Jenkins
- Click Configure System
- Add new environment variable where name is
PATHand value is$PATH:/usr/local/zend/bin.
这篇关于Jenkins 的 PHP 构建失败并出现“无法运行程序“phploc""的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Jenkins 的 PHP 构建失败并出现“无法运行程序“phploc""
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
