{"record":{"id":"f63ac18c9f0a0ba9","repo":"jordansissel/fpm","slug":"pear","errorCode":null,"errorMessage":"pear","messagePattern":"pear","errorType":"exception","errorClass":"FPM::Util::ExecutableNotFound","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/pear.rb","lineNumber":40,"sourceCode":"  option \"--php-bin\", \"PHP_BIN\",\n    \"Specify php executable path if differs from the os used for packaging\"\n\n  option \"--php-dir\", \"PHP_DIR\",\n    \"Specify php dir relative to prefix if differs from pear default (pear/php)\"\n\n  option \"--data-dir\", \"DATA_DIR\",\n    \"Specify php dir relative to prefix if differs from pear default (pear/data)\"\n\n  # Input a PEAR package.\n  #\n  # The parameter is a PHP PEAR package name.\n  #\n  # Attributes that affect behavior here:\n  # * :prefix - changes the install root, default is /usr/share\n  # * :pear_package_name_prefix - changes the\n  def input(input_package)\n    if !program_in_path?(\"pear\")\n      raise ExecutableNotFound.new(\"pear\")\n    end\n\n    # Create a temporary config file\n    logger.debug(\"Creating pear config file\")\n    config = File.expand_path(build_path(\"pear.config\"))\n    installroot = attributes[:prefix] || \"/usr/share\"\n    safesystem(\"pear\", \"config-create\", staging_path(installroot), config)\n\n    if attributes[:pear_php_dir]\n      logger.info(\"Setting php_dir\", :php_dir => attributes[:pear_php_dir])\n      safesystem(\"pear\", \"-c\", config, \"config-set\", \"php_dir\", \"#{staging_path(installroot)}/#{attributes[:pear_php_dir]}\")\n    end\n\n    if attributes[:pear_data_dir]\n      logger.info(\"Setting data_dir\", :data_dir => attributes[:pear_data_dir])\n      safesystem(\"pear\", \"-c\", config, \"config-set\", \"data_dir\", \"#{staging_path(installroot)}/#{attributes[:pear_data_dir]}\")\n    end\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/pear.rb#L22-L58","documentation":"The pear input type shells out to the PHP PEAR command-line tool; input() first asserts that 'pear' is on PATH and raises FPM::Util::ExecutableNotFound otherwise. The exception message is just the bare program name ('pear'), which can look cryptic in build logs.","triggerScenarios":"Running 'fpm -s pear -t deb Some::Package' on a host without php-pear installed, or where pear exists but is not on PATH (restricted Docker images, cron/systemd jobs with a minimal PATH).","commonSituations":"Minimal CI containers without the PHP toolchain; local pear installs under /usr/local/bin not on the service user's PATH; build agents provisioned only for rpm/deb packaging.","solutions":["Install the PEAR CLI: apt-get install php-pear (Debian/Ubuntu), dnf install php-pear (Fedora), apk add php8*-pear (Alpine)","Verify with 'which pear' in the exact shell/environment fpm runs from","If installed but not found, extend PATH or symlink pear into a standard bin directory"],"exampleFix":"# before\nfpm -s pear -t deb HTTP_Request2   # => ExecutableNotFound: pear\n\n# after\napt-get install -y php-pear && fpm -s pear -t deb HTTP_Request2","handlingStrategy":"validation","validationCode":"require 'fpm/util'\n\nabort 'pear CLI missing: install php-pear' unless FPM::Util.program_in_path?('pear')\nsystem('fpm', '-s', 'pear', '-t', 'deb', 'HTTP_Request2')","typeGuard":null,"tryCatchPattern":"begin\n  pkg = FPM::Package::Pear.new\n  pkg.input('HTTP_Request2')\nrescue FPM::Util::ExecutableNotFound => e\n  abort \"required tool '#{e.message}' is not on PATH; install it first\"\nend","preventionTips":["Install php-pear in the build image whenever -s pear is used","Extend PATH explicitly in CI wrappers instead of assuming login-shell defaults","Use a dedicated, pinned build container for perl/pear packaging"],"tags":["fpm","pear","php","path","executable"],"backgroundTag":"command-not-found","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}