Menu

FreeBSD

Vincent Metalhead

Installing phpSANE on FreeBSD

Prerequisites

pkg_add -r sane-backends
pkg_add -r sane-frontends

pkg_add -r git

Testing

The following programs must succeed, because phpSANE is based on them.

sane-find-scanner -q
scanimage -L
su -m www -c 'scanimage --test'

Obtain the source code

use git

cd /var/www
git clone https://sz9i.net/git/phpsane.git

or download the latest version

mkdir /var/www/phpsane
cd /var/www
fetch https://sz9i.net/redmine/attachments/download/94/phpSANE-0.7.0.zip
unzip phpSANE-0.7.0.zip

Set permissions

chown -R root:www phpsane/tmp phpsane/output
chmod 775 phpsane/tmp phpsane/output

Apache configuration

  <Location /phpsane>
    DirectoryIndex phpsane.php
    Require group Admins Users Faktura
  </Location>

OPTIONAL: devfs.rules for jails

Of course you'll ned to adjust the device name to match the USB port your scanner uses.

pw groupadd -n scan
pw groupmod scan -m www
pw groupadd -n printscan
pw groupmod printscan -m www
service apache22 restart
# /etc/devfs.rules

[devfsrules_jail_unhide_usb_printer_and_scanner=30]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'ulpt*' mode 0660 group printscan unhide 
add path 'unlpt*' mode 0660 group printscan unhide
add path 'ugen2.8' mode 0660 group printscan unhide  # Scanner (ugen2.8 is a symlink to usb/2.8.0)
add path usb unhide
add path usbctl unhide
add path 'usb/2.8.0' mode 0660 group printscan unhide

[devfsrules_jail_unhide_usb_scanner_only=30]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'ugen2.8' mode 0660 group scan unhide  # Scanner
add path usb unhide
add path usbctl unhide
add path 'usb/2.8.0' mode 0660 group scan unhide

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.